Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment:

Update nomenclature

Information

This is basically a SAF2Struts' s maven archetype plugin. It is used to create a working web application template for SAF2 where the user work build on top of. It is to serve as a little tool for rapid prototyping.

...

  • Sitemesh integration build in
  • A simple Struts2 Struts action example (both instantiated through Spring and SAF2 itself)
  • A simple Struts2 Struts validation example (action and action-alias level)
  • A Simple Struts2 Struts conversion example (global and action level)
  • A simple Struts2 Struts resource bundle (both global, action and package level)

Installing

...

Maven archetype for Struts 2

  1. Change directory to SAF2's the maven archetype directory eg. from Struts2Struts' s root directory (You will need the Struts2 Struts 2 source from SVN)
    Code Block
       cd ./struts2-archetype-starter <press enter>
    
  1. Run the following command to install Struts2 maven archetype into one's local maven repository (typically at ~/.m2/repository where ~ is the user directory)
    Code Block
       mvn install
    
  1. If "build succesfullsuccessful" is shown at the console after execution of the above command, the Struts2 maven Maven archetype plugin is successfully installed.

Create

...

Struts Web

...

Application Template

To create a workable template of Struts2 :-

  1. Change directory to where the web app application template is to be created eg. assuming the directory to be myWebApp.
    Code Block
        mkdir /home/tmjee/myWebApp
        cd /home/tmjee/myWebApp
    
  1. Run the following command to generate the sample web app template, assuming:-

    Root java Java package

    com.myCompany.mySystem

    The webapp war WAR name

    myWebApp

    Code Block
      mvn archetype:create -DgroupId=com.myComp.mySystem -DartifactId=myWebApp 
      -DarchetypeGroupId=org.apache.struts -DarchetypeArtifactId=struts2-archetype-starter
    

Using the created

...

template

Following are some maven Maven command that might be handy when using the generated Struts2 web app template :-

  • To compile
    Code Block
       mvn compile
    

...

  • To package
    Code Block
       mvn package
    
  • To grab necessary jar JAR files etc.
    Code Block
       mvn initialize
    

...