During the last couple of weeks I've been playing with news ways to speed up development on webapps, and through a tip by Joe Walnes, I found that using Resin speeds up development by a great deal! Basically, here's what I've done:
- Using IDEA, I placed all the resin libraries in my classpath (make a Library called Resin so you can use it in all your projects)
- Then make a local application configuration inside of IDEA called "Resin" with the following settings:
- class - com.caucho.server.http.HttpServer
- VM params - -Dresin.home=.
- program params - -conf resin.conf
- Lastly, you need a resin.conf file in your root project directory. You can take the default resin.conf file and trim it down, but some key settings you need are:
- servlet-classloader-hack - true
- doc-dir - src/webapp
- make your webapp id be "/" (the root)
- classpath id='../../build/java', source='../java', compile='true' (inside of webapp)
- place extra classpath elements to where your settings, such as osworkflow.xml, might be
That's it! Fire up resin and if all goes well it'll automatically recompile your sources every time you make a change and then redeploy the app. The end result is that working on your java classes becomes as simple to work with as JSPs are, especially since IDEA saves the files when you switch to your browser, and Resin reloads the classes on the next HTTP request.
The only problem I ran in to is if a third party libary (say, WebWork) is invoking one of your classes, after a reload you might start getting ClassCastExceptions. To get around that you need to add a classpath entry to the jar file (webwork.jar, for instance) in resin.conf.
10:35:46 PM
|
|