Versions Compared

Key

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

Merge Ant example

...

The Ant buildfile will prompt you for a the name of your new application.

No Format

new:
     [echo]
     [echo]             +=============================================================+
     [echo]             |              -- Create a new web application  --            |
     [echo]             +=============================================================+
     [echo]

    [input] Enter the name of your new application [myapp]? saf-sample
     [echo] Creating 'saf-sample' web application...
     [copy] Copying 7 files to /Users/rainerh/projects/action2/webapps/saf-sample
     [copy] Copying 1 file to /Users/rainerh/projects/action2/webapps/saf-sample
     [echo]
     [echo]             +=============================================================+
     [echo]             |    -- Your Web Application was created successfully! --     |
     [echo]             |                                                             |
     [echo]             | Now you should be able to cd to your application and run:   |
     [echo]             | > ant build -Dwebapp=saf-sample                              |
     [echo]             +=============================================================+

BUILD SUCCESSFUL

This task creates a new directory within the webapps dir.

For example, this is the setup for a new webapp project created with 'ant new' webapp name 'saf-sample':

No Format

webapps/
  saf-sample/
    src/
      java/
         org/apache/struts/action2/example/HomeAction.java -- A simple action example implementation
      webapp/
        index.jsp -- redirects to home.action
        WEB-INF/
          classes/
            action.properties -- Simple properties to use Spring and run SAF in devMode
            action.xml -- Basic action mapping sample with one action mapping
          pages/
            home.jsp -- The home.jsp referenced via the HomeAction
          applicationContext.xml -- blank Spring definition file. Add your Spring beans here.
          web.xml -- basic web.xml for SAF

You can now use the newly created project structure to get your SAF-based project running.

Setting up from scratch

If for some reason the blank template doesn't work for you, it's not so hard to setup a SAF-based application from scratch.

...