PSquad's Corner


PSquad's Corner

 ::home::  ...stuff... ::java::  ::school::  ::technology::  ::misc:: 


Sunday, December 29, 2002

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    comment []

December 2002
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
Nov   Jan




Copyright © 2002 Pat Lightbody