storing a file in web context root
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/")
.
精彩评论