views:

645

answers:

6

Hi

Is there any way I can speed up the development of JSF in Eclipse and Tomcat?

Basically I'm looking for a way to make the client-side changes (.jsf, .html, .css, .js) to happen a lot faster, and with out having to restart tomcat.

And if possible, also a way to make tomcat (or any other Windows + Eclipse compatible Servlet Container), restart a lot faster.

Because if I compare to my experience with ASP.NET/Visual Studio/IIS, it feels like I'm spending half the day waiting for Tomcat to restart, and sometimes I even get 404 in the browser, since it's not going fast enough.

There MUST be some other way to be more productive, and still allow more test driven development.

A: 

I believe MyEclipse, if configured correctly, will let you update applications running in Tomcat without restarting Tomcat. It is unfortunately a commercial product though.

Oracle JDeveloper had a copy of OC4J bundled and it was possible to make changes on-the-fly without restarting the container, again this may not be possible given your environment.

Phill Sacre
+2  A: 

Just in case you use Maven to build your project, you can use this command line to test in Tomcat:

mvn clean war:exploded tomcat:run

That will run a slim instance of Tomcat (tomcat:run) taking the changes of your web files (.jsp, .html, .css, .js) directly from the source you're editing (war:exploded), so you'll just hit F5 in your browser

victor hugo
A: 

If I'm not mistaken you can just copy your client-side changes (.jsf, .html, .css, .js) to the webapps folder of your application, whilst it is running. The jboss J2EE version of Eclipse I'm using allows hot replacement of some java code.

Martlark
I'm running the application directly from Eclipse (normal, Ganymede), so there's no webapps folder for me. Would there be a way to configure the webapps folder to be equal to the Eclipse folder?In IIS I can setup a Visual Directory in my dev folder, for client-side changes to be *really* fast (not even copied!, since it's already there).
Claus Jørgensen
A: 

A quick and dirty way to force Tomcat to recompile/reload your pages is to delete Tomcat's working directory. In my limited testing it works fine but obviously, I wouldn't recommend this in production. :)

Drew
A: 

You can use some other container, not tomcat, which not needed to be restarted when you make some changes in you project. It's can be Jboss. Also If you will use some tools, for example JBoss Tools, you develop much faster and easy :-) As for me, when you make changes just in .css or .xhtml page, you shouldn't restart tomcat, you should just republish you application. In JBoss Tools you can make it using JBoss Tools server view.

Maksim Areshkau
This is just a configuration matter. It works fine with Tomcat and other decent appservers as well, you just need to set the autodeploy/hotdeploy to true.
BalusC
A: 

You should use Dynamic Web Projects and tell Eclipse JEE to deploy to a suitable Tomcat instance. This will allow Eclipse to help all it can (but that is still not blazing speed though).

Thorbjørn Ravn Andersen