Installation

Installation of WebWork is not very different from any other framework. Download the latest release (or nightly build, if you like living on the edge), and unpack the compressed file. You should see the following directory structure (left out some files for brevity):

  • [webwork-2.2.x]
    • [dist]
      • webwork-static-2.2.x.zip //contains static (javascript) resources such as dojo, jscalendar, tooltips, ..
      • webwork-nostatic-2.2.x.jar //smaller webwork jar, contains no static resources
    • [docs] //wiki documentation in html and pdf
    • [lib] //jars in subdirectories required for a webwork installation
    • [src] //full source from webwork unpacked
    • [webapps] //example webapps
    • webwork-2.2.x.jar //webwork framework
    • webwork-src-2.2.x.jar //webwork framework source code

Webapp layout

Now, a typical (minimal) layout for a webapplication in WebWork may look like this:

  • [js] //contains extra javascript files
  • [images]
  • [template] //contains extra templates for custom themes, etc ..
  • [WEB-INF]
    • [classes] //contains your compiled application
      • xwork.xml //contains your action declarations
    • [src] //contains your application's source files
    • [lib] //contains the required libraries
    • [pages] //contains the view layer (jsp, freemarker, velocity)
    • applicationContext.xml //required by the Spring IoC container
    • web.xml //standard webapp descriptor

Minimal dependencies

The following libraries should be copied to your WEB-INF/lib folder (they can be found in the webwork/lib folder in various subdirectories).
If you get a ClassNotFoundException, it mostly means that you should add a jar from the webwork/lib folder. If you're not sure about which jar, use a standard decompression tool (7-zip, winzip, ..) to open the files and look inside to see if you can find the correct .class file.

  • cglib.jar
  • commons-attributes.jar
  • commons-logging.jar
  • freemarker.jar
  • ognl.jar
  • oscore.jar
  • rife-continuations
  • spring-aop.jar
  • spring-beans.jar
  • spring-context.jar
  • spring-core.jar
  • spring-web.jar
  • webwork-2.2.x.jar
  • xwork.jar

Further reading

With this setup, it's time to move onward. First, you should edit your web.xml, then your xwork.xml. Have a look at the Spring integration (you'll have to make sure your applicationContext.xml is correct), and finally move on to the first Tutorial.