On Wed, 21 Mar 2001, Glenn Nielsen wrote:

> Remy,
> 
> The ability to compile JSP pages directly from a WAR file without
> unarchiving jar files and class files into a work directory will not
> be possible until javac can use URL's instead of a file system classpath.
> Those changes to javac will not be available for quite a while.
> 

Glenn, I'd like you to revert the recent patches you did regarding the
Jasper classpath attribute ... at least until after beta 2.  It broke
things that were already working for me.

> Until that time I think the Context path should exist so that
> getRealPath(), getResource(), getPathTranslated() work for jar and
> class files broken out into the work directory.
> 

Nope ... there is no such thing as a disk file pathname to the context
root when you are running out of a WAR
file.  ServletContext.getRealPath() (and therefore
HttpServletRequest.getPathTranslated()) will return null in such a
case.  It's up to Jasper to deal with that issue, and figure out the last
modified date a different way -- by opening the URLConnection and checking
the lastModified property.

ServletContext.getResource() and ServletContext.getResourceAsStream() are
the portable mechanisms to access the static resources of the web app,
including the source code to JSP pages.

> I have implemented a way to dynamically build the classpath needed
> by javac using the URLClassLoader.getURLs() that works great in Jasper
> except for web apps running from a war file because I can't find any
> way to get the real system file path to the jar files or classes directory.
> This allows decoupling of Jasper from Tomcat for the CLASSPATH attribute.
> 

That's why the previous code pulled out a copy of the JAR files into the
WORK directory.  This was working right, and got broken by your patch.

> We can put comments in both Tomcat & Jasper that this can be removed once
> javac supports URL's in addition to the classpath.
> 
> Regards,
> 
> Glenn
> 

Craig


> Remy Maucherat wrote:
> > 
> > Quoting Glenn Nielsen <[EMAIL PROTECTED]>:
> > 
> > > Is the ability to run from a WAR file directly without unarchiving it
> > > into the webapps directory completely implemented?
> > 
> > No, I'm working on some fixes for Jasper (including one for the trace you
> > included).
> > 
> > > Jasper gives me a null pointer when it tries to see if a JSP needs
> > > to be recompiled in its Outdated method because getRealPath() returns
> > > null,
> > > getServletConfig().getServletContext().getRealPath(jspUri));
> > 
> > Here, it should use getServletConfig().getServletContext().getResource
> > (jspUri).openConnection().getLastModified().
> > 
> > There are other places where Jasper will break because of over reliance on
> > getRealPath() and getPathTranslated() (in both cases, the servlet container is
> > allowed to return null, and will do so when there is no physical file on the
> > filesystem).
> > 
> > Remy
> 
> -- 
> ----------------------------------------------------------------------
> Glenn Nielsen             [EMAIL PROTECTED] | /* Spelin donut madder    |
> MOREnet System Programming               |  * if iz ina coment.      |
> Missouri Research and Education Network  |  */                       |
> ----------------------------------------------------------------------
> 

Reply via email to