You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Steve Loughran <st...@apache.org> on 2006/10/02 11:26:50 UTC

Re: Precompile JSP

Hanmay Udgiri wrote:
> Hi
> I want to pre-compile my JSP after taking from CVS.
> I have websphere 5 installed on linux box.
> what comamnd I need to use to compile my JSPs
> Does the following command works
> 
>     <jspc srcdir="${src}/WebContent" destdir="${build}/WebContent"
> package="com.jsp" compiler="jasper41" verbose="9">
>           <include name="**/*.jsp"/>
>            <classpath>
>                <pathelement path="${datashopper.classpath}"/>
>            </classpath>
>        </jspc>
> 

No. It only works for jasper41, not for websphere, so your precompiled 
classes wont work.


I would recommend avoiding bothering to precompile JSP pages. Instead 
write tests using HttpUnit that fetch every single JSP page. That not 
only gives you the compilation, it gets you started on those tests you 
are going to need anyway.

-steve

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Precompile JSP

Posted by Steve Loughran <st...@apache.org>.
Martin Gainty wrote:
> If he wants a more granular approach such that the JSP compiler step errors out - there would be no confusion on whether
> the JSP page failed because of JasperCompiler error -or- because of the unit test

what you do is have some tests that just get all the pages; other tests 
to do work on them. the troublespot is those pages that only work with 
the right parameters/session/state, so you cannot do a blind get without 
the app being in the right state.

> In any case where would you specify the JasperCompiler (assuming this is accomplished thru taskdef) for HttpUnit?

You dont, you just get the remote page and let the back end choose the 
right compiler. HttpUnit is just helper classes for junit or other java 
test frameworks to fetch, parse, walk and execute HTML pages.

If you havent played with HttpUnit, and your project involves web pages 
on a server, I would strongly encourage you having a play with it.

-Steve

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Precompile JSP

Posted by Martin Gainty <mg...@hotmail.com>.
If he wants a more granular approach such that the JSP compiler step errors out - there would be no confusion on whether
the JSP page failed because of JasperCompiler error -or- because of the unit test
In any case where would you specify the JasperCompiler (assuming this is accomplished thru taskdef) for HttpUnit?
Thanks,
Martin--
*********************************************************************
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.



----- Original Message ----- 
From: "Steve Loughran" <st...@apache.org>
To: "Ant Users List" <us...@ant.apache.org>
Sent: Monday, October 02, 2006 5:26 AM
Subject: Re: Precompile JSP


> Hanmay Udgiri wrote:
>> Hi
>> I want to pre-compile my JSP after taking from CVS.
>> I have websphere 5 installed on linux box.
>> what comamnd I need to use to compile my JSPs
>> Does the following command works
>> 
>>     <jspc srcdir="${src}/WebContent" destdir="${build}/WebContent"
>> package="com.jsp" compiler="jasper41" verbose="9">
>>           <include name="**/*.jsp"/>
>>            <classpath>
>>                <pathelement path="${datashopper.classpath}"/>
>>            </classpath>
>>        </jspc>
>> 
> 
> No. It only works for jasper41, not for websphere, so your precompiled 
> classes wont work.
> 
> 
> I would recommend avoiding bothering to precompile JSP pages. Instead 
> write tests using HttpUnit that fetch every single JSP page. That not 
> only gives you the compilation, it gets you started on those tests you 
> are going to need anyway.
> 
> -steve
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
>