tags:

views:

712

answers:

9

I'm working for the first time on a project that requires building a webapp which makes heavy use of JSF (and ICEfaces in particular). There's a mix of stuff to be coded including CSS, HTML, JSP/Java and, of course, JSF.

I'm doing all this within Eclipse btw and using a local tomcat server which eclipse is responsible for launching in order to run the app.

Anyway, I notice all this is rather painfully slow. When I change one piece of JSF I have to restart the webserver so I can view the new results. Often I'm just interested in playing with the layout and the 10-15+ seconds it takes to stop, restart, refresh is driving me crazy. I reboot tomcat a hundred times a day -- argh! I need quicker turnaround!

Am I doing something wrong? Is this the natural state for all you web developers?

+4  A: 

Hello,

I am developing my applications in JSF with almost the same configuration (Tomcat 5.5 run by my Eclipse 3.3 with JBoss Tools). I am using also Facelets for JSF, and there is an important context parameter in web.xml I can to set in order to be able to modify my XHTML files with an automatic refresh (i.e. I don't need to restart Tomcat to see my changes). So, in my web.xml, I have this:

<context-param>
 <param-name>facelets.REFRESH_PERIOD</param-name>
 <param-value>1</param-value>
</context-param>
romaintaz
+2  A: 

I am developing JSF application with eclipse and maven.It automatically reloaded when a change is made on the program and you save that change.You have to restart when you change any configuration file.

Warrior
+1  A: 

I am using eclipse and Maven for JSF programming.

BlackPanther
A: 

You can probably work around this, atleast for the layout/markup bits, by directly copying your updated Markup files into the appropriate webapp directory.

Take a look at the exploded WAR file and find where your markup file is. You can either change that directly or move the updated file there. A browser refresh later and your markup should be changed!

You can probably do this faster by adding an ANT command to do this. I'm working with Netbeans and I'm not very good with ANT (and my deadlines don't give me time to figure it out) so I made a little shell script that 'cp's all my files into the exploded WAR directories.

If you change Java or configuration files, however, you'll need to redeploy the WAR. I'm not sure what version of Tomcat you're running but to do this on my Tomcat 6 instance, simply moving the WAR file into the webapps directory will cause Tomcat to pick it up and redeploy.

Becareful though! Tomcat 6's hot deploy functionality works fine but it does not free the PermGen memory used by the prior deployment correctly. Therefore, after a few hot deploys, Tomcat starts throwing "PermGen error: Out of Memory" exceptions and your only recourse is to reboot.

Drew
A: 

If you're just playing with CSS then use something like Firebug to edit it in-place, then when you're happy you can copy and paste it all in one go into Eclipse. Ditto HTML; in fact, when you know where your JSF components are going, just make a dummy page and then edit that in a fast web development IDE.

Frequent reboots of Tomcat are not normally necessary for web development :)

Robert Grant
A: 

I use the Jboss Developer Studio (v2.0) and have my project set up to hot-deploy. This means that I don't have restart for any changes aside from Entities, EJBs and Message Bundles. Perfect for mostly POJO projects.

Damo
A: 

I used to develop JSF pages myself in Eclipse without any designer tools (I don't like them). It's hard to make complex UI layout with designer tool - tools are only for simple layouts. When you have a lot of DHTML, CSS, you should write pages yourself.

About server restart: if you will configue you Tomcat in a right way, changing JSP page won't cause to server restart (hot deploy or smth like this). If you change methods signatures in beans, of course you must restart.

A: 

You should not have to restart Tomcat to see your changes. Just copy the WAR in $CATALINA_HOME/webapps should make the application be redeployed by itself. It takes a few seconds, though.

There are several means to deploy, see this doc for Tomcat 6: http://www.mbaworld.com/docs/appdev/deployment.html

ckarmann
+1  A: 

Hello

I used to have the same problem. Quick solution to have instant redeploy of your code use JavaRevel (free for non commercial use, costs pennies if you wanna use it in your company) http://www.zeroturnaround.com/javarebel/

hope this helps,