How do you develop JSF applications?

I am working for the first time on a project that requires the creation of a webapp that makes heavy use of JSF (and ICEfaces in particular). There is a set of coding materials, including CSS, HTML, JSP / Java, and, of course, JSF.

I do all this in an Eclipse environment and use the local tomcat server, for which the eclipse is responsible for launching to launch the application.

In any case, I notice that all this is rather painfully slow. When I change one part of JSF, I have to restart the web server so that I can view the new results. Often I’m just interested in playing with the layout and 10-15 + seconds that need to be stopped, restarted, updated, driving me crazy. I reboot tomcat a hundred times a day - argh! I need a quick turn!

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

+4
source share
8 answers

I develop my applications in JSF with almost the same configuration (Tomcat 5.5 works under Eclipse 3.3 with JBoss Tools). I also use Facelets for JSF, and there is an important context parameter in web.xml that I can set to be able to modify my XHTML files with automatic updating (i.e. I do not need to restart Tomcat to see my changes). So, in my web.xml, I have this:

<context-param> <param-name>javax.faces.FACELETS_REFRESH_PERIOD</param-name> <param-value>1</param-value> </context-param> 
+8
source

I am developing a JSF application with eclipse and maven.It will automatically restart when you make changes to the program and you save this change. You must reboot when changing any configuration file.

+3
source

Perhaps you can work around this, at least for the layout / markup bits, by copying the updated markup files to the appropriate webapp directory.

Take a look at the exploded WAR file and find where your markup file is located. You can either change this or transfer the updated file there. Update your browser later and your layout should be changed!

You can probably do it faster by adding the ANT command for this. I work with Netbeans and I am not very good with ANT (and my deadlines do not give me time to figure this out), so I made a small shell script that 'cp all my files in exploded WAR directories.

If you change Java or configuration files, you will need to reinstall WAR. I'm not sure which version of Tomcat you are using, but for this on my Tomcat 6 instance, just moving the WAR file to the webapps directory will force Tomcat to pick it up and reinstall it.

Do not worry! The hot deployment functionality of Tomcat 6 works fine, but it does not free the PermGen memory used by the previous deployment correctly. Therefore, after several hot deployments, Tomcat starts throwing "PermGen error: Out of Memory" exceptions, and your only regression is a reboot.

0
source

If you're just playing with CSS, use something like Firebug to edit it in place, and then, when you're happy, can copy and paste everything in one go in Eclipse. The same HTML; in fact, when you know where your JSF components go, just create a dummy page and then edit it in the fast IDE web development .

Frequent Tomcat reboots are usually not needed for web development :)

0
source

I am using Jboss Developer Studio (v2.0) and my project is set up for hot deployment. This means that I do not have a restart for any changes other than Entities, EJB, and Message Bundles. Ideal for POJO projects.

0
source

I myself developed JSF pages in Eclipse without any design tools (I don't like them). It is difficult to make a complex layout of the user interface using the development tool - the tools are intended only for simple layouts. When you have a lot of DHTML, CSS, you must write the pages yourself.

About server reboot: if you configure Tomcat correctly, changing the JSP page will not cause the server to restart (hot deployment or smth like this). If you change the method signatures in beans, you must of course reboot.

0
source

You do not need to restart Tomcat to see your changes. Just copy the WAR to $ CATALINA_HOME / webapps so that the application is redistributed on its own. It takes a few seconds.

There are several deployment methods, see this document for Tomcat 6: http://www.mbaworld.com/docs/appdev/deployment.html

0
source

I had the same problem. A quick solution for instantly redistributing your code uses JavaRevel (free for non-commercial use, it’s worth a penny if you want to use it in your company) http://www.zeroturnaround.com/javarebel/

hope this helps

0
source

All Articles