开发者

storing a file in web context root

开发者 https://www.devze.com 2023-03-27 04:53 出处:网络
I am writing a j2ee app and at one place i m capturing image from external source and i want to store the image to the web root of my app.

I am writing a j2ee app and at one place i m capturing image from external source and i want to store the image to the web root of my app.

I am not able to find how do it get the path for web root directory?

The defualt path if try to get is actually the jvm path not the web root.

Ther web server i m using is weblogic

I can get the ReqestContext etc but that is also the web url contenxt no the real path.

If there is any other way to store 开发者_运维知识库it as image then also it is fine,


You can use ServletContext.getRealPath("your/path/").

0

精彩评论

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