Unless you have a directory ${TOP}/web/html/jsp/jsp your uribase/uriroot probably aren't right.

[EMAIL PROTECTED] wrote:
Hi,

I am trying to get our JSPs to be precompiled as part of
our ant build process to catch all syntax errors at compile
time.

The problem I have run into is that we are using apache +
tomcat and we have set the following rules in apache httpd.
conf:

   JkMount /servlets/* ajp13
   JkMount /jsp/* ajp13
   JkMount /controller/* cont
   JkMount /cgi-bin/java-rmi.cgi ajp13

Inside some of our servlets and JSPs, they refer to other
jsps using the absolute URL "/jsp/" which works in deployed
environment because apache redirects it.  For example, in
one JSP we have  <%@ include file="/jsp/Header.jsp" %>

I setup the tomcat-4.1.30 ant jspc task and it was giving a
NPE. Then I tried the Ant Jspc optional task, and it gave
me an error message:

the file '\Status.jsp' generated the following general
exceptionn: org.apache.jasper.JasperExeption: /Status.jsp(3,0) File "/jsp/Header.jsp" not found

Is there any quick and dirty way to get the JspC to resolve
the "/jsp/*.jsp" urls to "*.jsp" or is there no way?

My alternative is to try to change all the "/jsp/*.jsp"
references to "*.jsp" everywhere we do an <%@ include %> or
<jsp:include/> or <jsp:forward/>. I think  that would be ok
since those directices are handled on the tomcat side. Changing
it would be kind of messy since we have a ton of JSPs in a large directory hierarchy, so some of those "/jsp/Header.jsp"
references would have to be changed to "../../Header.jsp", etc.
I know I can't get away from the "/jsp" mapping completely
because we have URLs and HTTP redirects which depend on it.

Here is the quick and dirty jspc ant target I created:
 <jspc
     srcdir="${TOP}/web/html/jsp"
     uribase="${TOP}/web/html/jsp"
     uriroot="${TOP}/web/html/jsp"
     destdir="${TMP_DIR}/WEB-INF/src"
     compiler="jasper41"
     verbose="9">
     <include name="*.jsp"/>
     <classpath>
               <!--todo: including all the tomcat jars, overkill i
               know...-->
                <fileset dir="C:\Program Files\Apache Group\Tomcat
                4.1\bin">
                    <include name="*.jar"/>
                </fileset>
                <fileset dir="C:\Program Files\Apache Group\Tomcat
                4.1\common\endorsed">
                    <include name="*.jar"/>
                </fileset>
                <fileset dir="C:\Program Files\Apache Group\Tomcat
                4.1\common\lib">
                    <include name="*.jar"/>
                </fileset>
                <fileset dir="C:\Program Files\Apache Group\Tomcat
                4.1\shared\lib">
                    <include name="*.jar"/>
                </fileset>
                <fileset dir="C:\Program Files\Apache Group\Tomcat
                4.1\server\lib">
                    <include name="*.jar"/>
                </fileset>
                <!-- project classes and external 3rd party jar files
                -->
                <pathelement path="${CLASS_DIR}"/>
                <filelist refid="active.external.jar.filelist"/>
            </classpath>
        </jspc>

Thanks for any advice,
-Alex

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to