aspose file tools*
The moose likes Servlets and the fly likes Unable to load html file stored outside of the context root. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Unable to load html file stored outside of the context root." Watch "Unable to load html file stored outside of the context root." New topic
Author

Unable to load html file stored outside of the context root.

Veena Grandhi
Greenhorn

Joined: Mar 13, 2008
Posts: 9
Hi All,

Any one please help ASAP.
We are having a servlet which will create dynamically html file based on the query and store it in the filesystem.Now i am not able to load that html file as it is not present under context root.How shall i specify the url or load that file?
I tried loading that file directly like http://localhost:9080/CONTEXTROOT/html/atwRpt_12052008.html ,but it is not able to identify.Hope picture is clear..html is the folder which is present outside CONTEXTROOT and i need to load the html file

To give background OS: Solaris, WAS version 6.0.2.17.
Please suggest me urgent..

Regards,
Veena
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

by default, WAS starts with a security policy which prevents access to files outside the context root.

You haven't provided any details on how your code reads or writes to this 'external location', so it is a bit hard to provide additional information.
Veena Grandhi
Greenhorn

Joined: Mar 13, 2008
Posts: 9
Hi ..
Thanks for responding.

Servlet is trying to create the file like
fout = new PrintWriter((new FileOutputStream(rptDir + "/" + fileName, false)), true);

and it is trying to load as out.println(webFilePath+ "/" + fileName);

Here rptDir is some thing like /bpp_atw/rel/docs/atwRpt_web
and webFilePath is atwRpt_web.

I tried appending / before webFilePath ..no luck..i created a softlink atwRpt_web,under contextroot and pointing to the report directory.

Please let me know if you need any further detrails..

Regards,
Veena
Veena Grandhi
Greenhorn

Joined: Mar 13, 2008
Posts: 9
Please any one suggest...
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Unable to load html file stored outside of the context root.