Editing Java webapps instead of edit/deploy/reload
For the last few years, I've always done Java webapp development the hard way. Yeah, I'm the guy that makes Dion cringe (although I'm pretty sure he's not referring directly to me). I edit a class/jsp/xml file and run "ant deploy reload". Then I wait a few seconds for my context to reload in Tomcat. Luckily, I do mostly test-first development, so it's rare that I have to open my browser to test stuff. However, with the power of CSS and Ajax, manual testing in a browser is becoming more and more useful (although Selenium may solve that).
I've long resisted the power of the IDE, b/c I've always trusted Ant and felt confortable with the command line. However, I'm ready for a change. I'm ready to start developing Equinox and AppFuse-based applications using the edit/save/auto-reload cycle. So how do I get started? Where's the instructions for setting up my IDEs to work this way?
I prefer to use Eclipse and IDEA for development - so I'll likely try to get this working in both. If I get it working, I'll make sure and provide good documentation so others can do the same. I'm also willing to make any changes in project structure to make this happen; modifying build.xml (or pom.xml) to accomodate shouldn't be too difficult.


Posted by Todd Huss on November 07, 2005 at 08:54 PM MST #
Posted by Todd Huss on November 07, 2005 at 09:07 PM MST #
Isn't everyone doing it?
.V
Posted by Vic on November 07, 2005 at 09:52 PM MST #
Posted by Juze Peleteiro on November 07, 2005 at 10:52 PM MST #
Posted by pic on November 07, 2005 at 11:17 PM MST #
Posted by Keith Weinberg on November 08, 2005 at 12:51 AM MST #
Posted by pic on November 08, 2005 at 01:42 AM MST #
Posted by Martin Paoletta on November 08, 2005 at 02:12 AM MST #
Posted by afsina on November 08, 2005 at 03:54 AM MST #
Posted by James on November 08, 2005 at 04:52 AM MST #
- Yes, I use the Sysdeo plug-in. Later I want to play with the Eclipse Web Tools project a bit more as it seems to have a decent JSP editor that does not have the overhead of something like NitroX. For now its Sysdeo though.
- The build is broken into these steps:
- xdoclet generation, output is into directory "src-gen". I do a lot of this.
- compile Java files into "web/WEB-INF/classes".
- copy generated/manipulated configuration files under "web/WEB-INF"
- The above three steps take right at a minute - from this point on, I can use the Eclipse debugger and make changes to my Java files on the fly.
- The only files under the "/web" subdirectory (including "WEB-INF", ...) are files that are hand-coded and not modified by xdoclet
- Obviously deployment descriptors generated by ant/xdoclet have to be copied under "web/WEB-INF".
- Obviously my "clean" target has to clean out anything I moved under "web".
- And I have a slightly third step above that I do so I can build a war file for production deployment.
I keep saying "What too me so long to do this?"Posted by Richard on November 08, 2005 at 06:40 AM MST #
Posted by Eddie O'Neil on November 08, 2005 at 06:45 AM MST #
Posted by Davide Baroncelli on November 08, 2005 at 08:11 AM MST #
Posted by Rene Lavoie on November 08, 2005 at 12:13 PM MST #
Posted by Matthew Fleming on November 08, 2005 at 06:27 PM MST #
Posted by Dmitry Kashin on November 17, 2005 at 10:26 AM MST #
Posted by Geoff Longman on November 25, 2005 at 03:45 PM MST #
Posted by Richard on December 17, 2005 at 09:29 PM MST #
Posted by Samuel Velázquez on April 06, 2006 at 10:51 PM MDT #
Sorry, but somehow I missed your Dec 17th post so did not respond. But still, I believe the details really are in my original post. Consdier that I took a snapshot of appfuse (actually Struts Resume at the time) in January 2003, re-synched it with many of the improvement in AppFuse in summer 2005. During and since them I have modified it as my application grew and evolved. But the steps above are a pretty good guideline. It has completely changed my mind about the usefulness of IDE's for anyone but a newbie.
Also, I am now using Sysdeo with the all-in-one WTP Eclipse bundle now. The editors that come with WTP for Javascript, CSS, HTML, JSP, etc - may not be the absolute best, but they are all there. I have hesitated to use WTP's servers in place of Sysdeo's because of horrible performance stories I have heard. I'll try it for myself one of these days.
Good luck - Richard
Posted by Richard on April 06, 2006 at 11:59 PM MDT #
Posted by Roni Burd on April 10, 2006 at 11:05 PM MDT #
Posted by Gary Affonso on May 17, 2006 at 05:47 AM MDT #
Hi ,
We use an ant task to hotswap only changed classes. The main trick is , do it with the JDI(Java Debagging Interface). You have to start your jvm in debugging mode and through it, you can hotswap only changed classes. Since it works on port, you can do this on remote machines also. The IDE (eclipse/netbeans/IDEA) do it the same way. But I prefer ANT for the deployment.
Here is the details about it in my blogpost
Posted by Sajid on July 29, 2008 at 05:31 AM MDT #