ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cost...@covalent.net
Subject Re: [GUMP] Test Failure - Ant
Date Wed, 14 Aug 2002 19:33:36 GMT
On Wed, 14 Aug 2002, Steve Loughran wrote:

> > On Wed, 14 Aug 2002, Steve Loughran wrote:
> >
> > > >
> > > > Does someone know the problem here ? I haven't follow the latest
> > > discussion
> > > > about jspc.
> > > >
> >
> > I'll try to add some stack traces in jasper. It's most likely a problem
> > with the classpath - and <javac> doesn't find the compiler ( tools.jar ).
> 
> a '1' error means that java isnt getting as far as running jasper, I think.

If you look at the stack trace, it seems jasper is called, it translates
the file, then calls ant <javac> - which exits with 1. 

There is a problem with displaying the messages, jasper is capturing the
output so it can parse the error and determine the line numbers.

> So the current algorithm is name -> name_jsp.java, with mutation of
> non-classname things.
> 
> And this is aligned with what tomcat4.1 expects inside, so can be used for
> precompilation, right?

Yes. Make sure you also generate the web.xml fragment - it's the safest
( and faster - you avoid JspServlet ). 

What I use is:

    <taskdef classname="org.apache.jasper.JspC" name="jasper2" >
      <classpath>
        <pathelement location="${java.home}/../lib/tools.jar"/>
        <fileset dir="${tomcat.home}/server/lib">
          <include name="*.jar"/>
        </fileset>
        <fileset dir="${tomcat.home}/common/lib">
          <include name="*.jar"/>
        </fileset>
        <pathelement location="${build.dir}/classes"/>
        <path refid="myjars"/>
      </classpath>
    </taskdef>
    
    <jasper2 verbose="0" 
             package="..."
             compile="true"
             validateXml="false"
             uriroot="${webapp.dir}"
             webXmlFragment="${build.dir}/generated_web.xml" 
              outputDir="${build.dir}/..." />
    
    <loadfile property="generated_web.xml" 
              srcFile="${build.dir}/generated_web.xml"  />

    <replace file="${jspui.webapp.dir}/WEB-INF/web.xml" 
             token="&lt;!--GENERATED_JSPS--&gt;" 
             value="${generated_web.xml}" />


Costin  


--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message