We are having an applet talking to servlet, which inturn talks to db and is creating dynamicall y html file and storing in filesystem which are for example under /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/ATWREPORT/rpthtml
Now the applet should load that html file and it is doing as below URL RptURL = new URL(getDocumentBase(),"rpthtml/atwRpt_30052008.html"); getAppletContext().showDocument(RptURL, "_blank");
Even file is present there ,it says not able to load. It is searching witn in the war file which is /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/ATWREPORT/ATWREPORT_war.ear/ATWREPORT.war/rpthtml
Please suggest any body what i am missing over here. OS:solaris,AppServer:WAS 6.0.2.17
If your app has not been deployed as an exploded file system (it's being run from a war or ear file), or, if your file is not being written to the web application's directory structure, you're not going to be able to access it from the web.
The way around this is to write a servlet that can read the file from the server's file system and stream it to the client. We have a sample app that does something similar which might be a good starting platform for you. This app reads the file from within the WEB-INF directory using getResourceAsStream; something you won't be able to do. If you alter it to read the file using java.io.File, you should be able to achieve the same thing.