File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Execution difference on Application Server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Execution difference on Application Server" Watch "Execution difference on Application Server" New topic

Execution difference on Application Server

Hean Hean

Joined: Jan 15, 2002
Posts: 1
I experienced a problem of retrieving a gif image from a servlet path, e.g. (http://localhost/folder/resource?id=xxxxxxxxx) when executing the code on the application server. But executing the path on the browser returns the image, and working with a simple java class in command compilation and execution returns the gif as well.
The Application server used is SilverStream eXtend Application Server 3.7.3.
Please if anyone has any experience such, lend a hand.. URGENT.
-Hean Hean
Joe Gilvary
Ranch Hand

Joined: May 11, 2001
Posts: 152
The path that a servlet can see is based on where
the servlet is installed in the application server.
Your servlet can do something like this:
ServletContext myContext = getServletContext();
String rootPath = myContext.getRealPath("") + "/";
Write out that String and you will know what the
servlet can see. You should put the files that you
want the servlet to use below that rootPath. Check
the Servlet information at
and check the documentation for your app server.
[ January 18, 2002: Message edited by: Joe Gilvary ]
I agree. Here's the link:
subject: Execution difference on Application Server
It's not a secret anymore!