[英]How to access json array that is passed from restful web service in android?
[英]How can I access local files from a RESTFul web service
我嘗試從RESTFul服務訪問本地文件。 有什么方法可以獲取正在運行的服務的真實路徑嗎? (就像我們在servlet中所做的那樣)
服務器:glassfish 3.0.1 IDE:Eclipse Helios
謝謝
您用於REST Web服務的框架是什么?
您可以通過以下方式獲得澤西島的真實路徑:
@Context ServletContext context //you can specify in your method argument
String realPath = context.getRealPath("/");
認為會對您有所幫助。
碼:
@Context ServletContext context;//you can specify this above method as annotation
String realPath = context.getRealPath("/");
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.