Web tier: servlets, JSP, Web frameworks: Precompiling JSPs in Oracle 10gAS/JDeveloper/Ant
Hello all, We currently have a J2EE application running on Oracle 10g AS. We use JDeveloper as the development tool and Ant for building our application code. I am wondering if there is a way where we can compile JSPs while building or deploying the application. Currently we are having to visit each page once after deployment to make sure user experience is not unusually delayed due to JSP compilation during first time access. Since this is not a fool-proof method (we can always miss out a page) and since this is too cumbersome, I am wondering if there is a good way to do it in either the ant script (which we use for build) or sometime during deployment. Any help appreciated.
- Posted by: Swami .
- Posted on: June 12 2006 19:38 EDT
Explore JSPC ant task , which helps u pre compile JSPs
Explore JSPC ant task , which helps u pre compile JSPsFrom past experience, precompiling with JSPC, on the development or build machine, is not necessarily a good idea. There seems to be issues with the output being 'incompatible' (in some way) with that which is produced when you let the container compile the pages in-situ. (I know that this seems to contradict the 'build once, run anywhere' philosopy of Java, but evidence suggests otherwise) Depending on your container, you should be able to get it to do the precomile for you, at deploy time. I'd investiagte the documentation for your container before deciding which option to take.
I agree. For example Oracle Application Server has several ways how to compile JSP to java, it is with or without compile tag reuse in several modes. We had a problem, that on one system it was on and on another it was off. We had some tag library which had bug in tag's release() method and as a side effect the bug was not reported and causing memory leaks if compile tag reuse was on, and was correctly reported when it was off. Java files generated from JSPs use server's internal classes, so if you don't have exact JSP precompiler as on the server, it could be dangerous, if working at all.