hi simon,

i just tried to introduce the same 'errors' you did and my
pre-compiling stopped and complained the following exception:

  [jasperc] 2004-06-30 10:38:20 - ERROR-the file '\jsp\Test.jsp'
generated the following general exception: java.
lang.NullPointerException
  [jasperc]     at org.apache.jasper.JspC.processFile(JspC.java:596)
  [jasperc]     at org.apache.jasper.JspC.execute(JspC.java:801)
  [jasperc]     at org.apache.jasper.JspC.main(JspC.java:823)

so it seems i'm getting the error-checking that you want.  the
difference is that i didn't use <taskdef> to do my pre-compiling.  i
just used ant's <jspc> task:

<jspc srcdir="${webapp.build}" destdir="gensrc/src"
uriroot="${webapp.build}"
compiler="jasper41"
includes="index.jsp,jsp/**/*.jsp"
verbose="9"
webxml="jspmaps">

<classpath>
<pathelement path="${tomcat.home}/common/lib/jasper-compiler.jar"/>
<pathelement path="${tomcat.home}/common/lib/servlet.jar"/>
<pathelement path="${tomcat.home}/common/lib/jasper-runtime.jar"/>
<pathelement path="${ant.home}/lib/ant.jar"/>
</classpath>

</jspc>

why do you need to define your own pre-compile task may i ask?

woodchuck


--- simon colston <[EMAIL PROTECTED]> wrote:
> I have set up an ant task to precompile JSPs and everything works
> fine 
> *if* there are no errors in the JSP.
> 
> The ant task is:
> 
> <target name="jspc" depends="prepare" description="Compile JSP
> files">
>   <taskdef classname="org.apache.jasper.JspC" name="jasper2" >
>    <classpath id="jspc.classpath">
>     <pathelement location="${java.home}/../lib/tools.jar"/>
>      <fileset dir="${extlib.home}">
>       <include name="**/*.jar"/>
>      </fileset>
>     </classpath>
>    </taskdef>
>    <jasper2 verbose="4"
>       validateXml="false"
>       uriroot="${build.home}"
>       webXmlFragment="${web.home}/WEB-INF/generated_web.xml"
>       outputDir="${build.home}/WEB-INF/src" />
>    <loadfile
>       srcfile="${web.home}/WEB-INF/generated_web.xml"                                
>   
> property="gen.web.xml">
>     <filterchain >
>      <tokenfilter delimoutput="\r\n"/>
>     </filterchain>
>    </loadfile>
>    <delete file="${web.home}/WEB-INF/generated_web.xml"></delete>
>    <delete file="${build.home}/WEB-INF/web.xml"></delete>
>    <copy tofile="${build.home}/WEB-INF/web.xml"
>       file="${web.home}/WEB-INF/web.xml">
>     <filterset>
>      <filter value="${gen.web.xml}" token="jspServlets"/>
>     </filterset>
>    </copy>
> </target>
> 
> If I introduce an error into the JSP page, such as:
> 
>       <c:url var="url"/>
>       <img src="${url}"/>
> 
> (where c: is the JSTL common taglib) the ant task ends without errors
> 
> and I get a NullPointerException when I test the page on the server.
> 
> How can I get my jspc ant task to show errors in the JSP?
> 
> Using Tomcat 5.0.25.
> 
> Cheers,
> 
> Simon
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 



        
                
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 

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

Reply via email to