-
1. Re: ServletContext.getRealPath() does not work in JBOSS 3.2/
jonlee Apr 25, 2003 9:26 AM (in response to jodybrownell1)When the servlet container cannot determine a valid file path for the method, such as when the web application is on a remote file system not accesible locally, in an archive or in a database, it will return null. So if your web application is still in a war, you will probably get this problem. In a standalone Tomcat, it normally unpacks the war so you can manifest a file path. Not so with the integrated Tomcat.
Short version - you have no absolute file path when the application files do not manifest themselves in a real, physical way. Which is fine with the spec.
I know that doesn't help much. You could try using properties already set but I'm not sure what you are after - for example you could read the jboss.server.home.dir. Or you can set properties in your web.xml for servlet initialisation. The only problem is the dependency inherent in this. -
2. Re: ServletContext.getRealPath() does not work in JBOSS 3.2/
adrian.brock Apr 30, 2003 9:55 AM (in response to jodybrownell1)Get real path only works with unpacked deployments.
It is part of the servlet spec.
You need to deploy your application using a directory
structure that looks like a war file.
deploy/myapp.war
deploy/myapp.war/WEB-INF/
deploy/myapp.war/WEB-INF/web.xml
deploy/myapp.war/index.jsp
etc.
Regards,
Adrian