开发者

File Can be accessed fwhile running jnlp but cannot be accessed through browser in java web start

开发者 https://www.devze.com 2023-01-27 05:18 出处:网络
I\'m trying to access a resource file which is in a jar file deployed in apache web server. The file can be accessed through the jnlp file in the deployed folder while but it is not available through

I'm trying to access a resource file which is in a jar file deployed in apache web server. The file can be accessed through the jnlp file in the deployed folder while but it is not available through the web start while trying to access from a browser.

The code 开发者_如何学JAVAused to access the file using the uri is something like below :

File helpFile = new File("/myFile.doc");

myFile is in the application jar deployed in the server.


A JNLP application is running locally on your machine so it will have 'file' access to the Apache web server. You have to access it with HttpURLConnection or any of the RESTful client API.

Furthermore, to access file locally on your server, you have to use the FileOpenService not File.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号