ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <ste...@apache.org>
Subject Re: How to compile jsp files with ANT
Date Wed, 21 Feb 2007 10:23:58 GMT
Rashmi Rubdi wrote:
> Hi James, 
> 
> I use the Jasper task to mainly reduce the time it takes to load a JSP page. 
> 
> I only execute the Jasper task just before creating the WAR file for the production environment.

You cant guarantee that Jasper code is compatible with anything other 
than the same version of tomcat; you need to use whatever jspc compiler 
your app server ships with. Unless you run on tomcat, is only good for 
catching errors before you deploy. But as deploy-by-copy is so easy, I 
prefer to skip this stage and not waste any time getting jspc to work.

> On the production environtment that gets multiple visitors throughout the day, every
time someone makes the *first* request to a particular JSP page - the container's compiler
compiles it for the first time. 
> 
> This is fine if the application is small but if the app has too many JSP pages then,
the container would compile each and every JSP page just once thus
> slowing the overall application response time especially if multiple users are accessing
different parts of the web app at the same time. Pre-compiling the JSPs makes the web application
response time much faster because the container only serves the class file. 
> 
> If you refer to the JSP 2.0 Final Release Specification (PDF) jsp-2_0-fr-spec.pdf on
page 1-7 , it lists all the benefits of pre-compiling JSPs.
> 
> I don't use the Jasper task for the development environment though, because one wouldn't
mind a negligible wait for just one JSP page in the development environment and
> also because the Jasper task takes a very long time to complete, it is not suitable for
a dev build but only for production build.

I do what John suggests and use HttpUnit.

1. you need those tests anyway
2. you can fetch all pages, including error pages and those that need 
auth (if your tests log in first)
3. you can also walk every link from the index page and verify you have 
no broken links

the hard part is writing the tests with side effects; the ones that add 
stuff to the shopping basket and pay for them, or which move money 
between bank accounts. But you know what? You need them anyway.

in a dev env, you deploy, run the tests while you go get a coffee and 
all is well. On production, you can run the tests on the live system 
immediately after every deployment.

Really, if you dont use httpunit, now is the time to learn :)

-steve

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


Mime
View raw message