This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes ServletContext.getRealPath didn't work on JRun 3.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "ServletContext.getRealPath didn Watch "ServletContext.getRealPath didn New topic
Author

ServletContext.getRealPath didn't work on JRun 3.0

Jhonson Garcia
Greenhorn

Joined: Aug 27, 2002
Posts: 3
Hi all,
I got a problem with ServletContext.getRealPath method that applied on JRun 3.0 application server.
The code is writed as below:
public String getPath(ServletConfig config){
ServletContext ctx = config.getServletContext();
return ctx.getRealPath("/");
}
The result string of the method above is "C:/", it didn't return the root directory application server. I also tested it on JRun 3.1, this time it return the root directory of the application server, exp: "C:/Jrun3.1/servers/myserver/myapp".
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: ServletContext.getRealPath didn't work on JRun 3.0
 
Similar Threads
JRun vs Tomcat, about the custom action
Different results for ServletContext.getRealPath
Different results for ServletContext.getRealPath
access properties file from servlet
Apache commons file upload does not work for me.