users@glassfish.java.net

Re: Compiling JSP is slow on v3

From: <glassfish_at_javadesktop.org>
Date: Wed, 08 Sep 2010 17:23:45 PDT

> Hey all,
>
> I can understand and appreciate the issue behind it
> being slow.. but if it's fast after first access, why
> not have it pre-compile them all upon deploy (at
> least to production)?
>
Yeah, we also recommend pre-compiling JSP files at production. But in some cases, JSP files are generated dynamically and accessed almost immediately. In such a case, it might make more sense not to pre-compile the JSP files to avoid a big response delay.

> Also, I am not sure if Eclipse can be set up this
> way, but I am pretty sure netbeans can just reload
> the jsp pages on the fly when you remotely connect
> the debugger... at least I think it can. I recall
> something like this in the past where I could save
> the .jsp page and it would reload when I accessed it
> without having to build/deploy the .war file each
> time. That said, I now do the build .war, redeploy to
> autodeploy folder myself. I still haven't figured out
> how to deploy without using the autodeploy folder
> short of using the admin interface to load the .war
> file. Is there some way to point a domain to one (or
> more) developer paths where are .war files are
> located.. or more so, our class files and web pages,
> so that it can quickly reload from our actual project
> path instead of having to redeploy each time we make
> a change?

If you use asadmin cli command to deploy your application, you can do so from a directory, without having to create a war file first. Just do a

    asadmin deploy path-to-your-dir

Once deployed, you can freely modify the JSP files in your directory, and they'll be compiled and loaded as needed. Doing it this way would also avoid long wait in the modify-deploy-run cycle, since only the modified JSP pages will be recompiled. If you do an asadmin deploy every time you change something, then potentially all JSP pages will need to be recompiled, because asadmin deploy wipes out all the generated files.
[Message sent by forum member 'kchung']

http://forums.java.net/jive/thread.jspa?messageID=482137