Hi,

I need to compute location of a local file relatively to the current JSP,
given the file's relative path.  Currently, I use the following code:

             String jspFilePath = new File(
((HttpServletRequest)pageContext.getRequest()).getServletPath() ).getParent();
             File sourceFile = new File( jspFilePath, relativePath);
             this.sourceUri = pageContext.getServletContext().getResource(
sourceFile.getPath() );

This has worked just fine for me under Tomcat 3.2, but under v.4.0, what I
get back as sourceUri is not a file uri, but rather something that starts
with 'jndi://[...]'

Is there a better way to accomplish what I want?

Regards
Dmitry

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to