You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Alex Muc <al...@utoronto.ca> on 2001/07/15 02:56:54 UTC
Jasper compiler from the command line
Hi,
I've been developing a webapp with Tomcat for a while now and one of the
problems I keep running up against is that when I make changes to my
underlying beans (ie. change of method signature) which are used by the
jsp pages in my webapp that I sometimes forget to make the necessary
changes across all jsps in the webapp which make use of the changed
beans. To help avoid this problem I created an ANT task to automate
running the Jasper compiler (see my recent message on
ant-user@jakarta.apache.org). And then let ANT report the compilation
problems to me.
Before I was able to get this task to run I had to make some
modifications to the jasper compiler because it wasn't operating
properly for my jsps. The problem was that in my jsps I make use of
static includes which are referenced via relative file paths in the
<%@include file="../include.jsp"%> directive by jsps which are in
various subdirectories of the webapp. This was causing problems for the
jasper compiler because the context wasn't being set properly in the
CommandLineContext.java object to be able to handle relative includes in
pages which were in some subdirectory of the webapp. Anyways, I made
some small changes to the constructor of CommandLineContext to fix the
problem. It works properly now, and it doesn't seem to introduce any
other problems.
I've attached my version of CommandLineContext.java as well as a diff
file. Hopefully someone with more appropriate access levels can look
over and check-in the changes. The diff file is a little screwy for
some reason, but I'm not good enough with CVS to be able to figure how
to fix it.
If you have any questions send me a reply.
Thanks
Alex.
P.S. Thanks to all the people who work on Tomcat. I've been using it
since the first beta and it just keeps on getting better.