You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

There are several resources available to help you create your own applications, including QuickStart and the various example applicastions.

Browse the Resources

There are online resources to help you along, every step of the way.

Distribution Quickstart

The distribution contains all the documentations, sources, and binaries, you need to get started on your application.

dist/
docs/
lib/
src/
src/java/template/
webapps/
README.txt
build.properties
build.xml
ivy.xml
osbuild.xml
pom.xml
struts-action-(VERSION).jar
struts-action-(VERSION).zip
struts-action-(VERSION)-src.jar

The docs directory contains the current Javadocs, the full user documentation including the document you are reading, and taglib documentation, as well as Clover, JUnit and dependency reports for the build.

The dist directory contains framework files with different packaging:

  • struts-action-nostatic-<version>.jar: containing only the framework without the static content
  • struts-action-static-<version>.zip: containing the required framework static dependencies

The lib directory contains the required as well as optional Dependencies for the framework, organized in subdirectories to represent different optional configurations:

lib/
      ajax
      bootstrap
      build
      cewolf
      default
      fileupload
      fileupload-cos
      fileupload-pell
      hibernate
      jasperreports
      jfree
      pico
      plexus
      portlet
      quickstart
      sitemesh
      source
      spring
      tiger
      tiles
      velocity
      xslt

Note that none of the optional packages are required to use the framework. If you wish to use certain features such as JasperReports or Java 5 (Tiger) generics and annotation support, then you must include the optional packages.

The framework also comes packaged with all the source files and templates for the JSP tags.

Running the Examples

Several example applications come bundled with the distribution that demonstrate many common use cases. You can run these using the QuickStart feature or in your own web container.

Running with QuickStart

The framework provides a slick way to jump into web development called QuickStart. Essentally, QuickStart is combination of technologies and conventions. The key feature is the ability to run web applications "out of the box" with a stripped-down Jetty container.

With QuickStart, running the demos is as easy as can be. You just need to run:

> java -jar webwork.jar quickstart:<application-name>

from the distribution's top directory, where <application-name> is one of the subdirectory names under webapps/. Each subdirectoy hosts a demo application.

If you want to start the shopping-cart webapp, the startup command would be:

> java -jar webwork.jar quickstart:shopping-cart

One the application starts up, point your browser to http://localhost:8080/shopping-cart/, and you should be ready to go.

Several example appliations are included in the distribution.

blank

Not really an example application, but a blank web application template to use as the base for your own applications

cookbook

A "how to" application that displays the full source code for each "recipe".

mailreader

The infamous Struts MailReader application.

portlet

Demonstration of our porlet integration (to be deployed in a Portal Server) - see the Portlet Tutorial to read more about portlets

shopping-cart

Simple example application demonstrating various aspects of the framework

showcase

Extensive demonstration of all tag and AJAX features, along with other examples and some best practices

starter

Basic web application that you can use as a starting point for experimenting with framework features - one could almost call it a "playground" application

You can review the QuickStart documentation to learn more about how it works and how you can utilize QuickStart with your own applications.

To Quickstart or not to Quickstart?

Quickstart is a handy tool for development of your applications. We recommend that you give QuickStart a try, to see if it meets your development needs. However, QuickStart is not meant to be your sole environment for web application development. QuickStart is meant to help you rapidily create proof-of-concepts and so that you can see the result. We recommend you always at least test your work under other applications servers, such as Tomcat, Resin, or even the standard, standalone version of Jetty.

Running with your web container

In order to deploy applications and demos to your favorite servlet container (also called web container) such as Apache Tomcat or Caucho Resin, you will need to build WAR files from the webapps directory. You will find an Antbuild file there which will provide you with an easy way to build your own WARs.
To build a web application archive (WAR), simply run:

> ant build -Dwebapp=$APP

where $APP is the name of the web application you want to build. After the build is finished, the fully-built WAR file can be found in the dist directory. You may deploy this file to any servlet container.

To build the {{showcase}] aplication, substite "showcase" for $ID.

> ant build -Dwebapp=showcase

To deploy the built showcase.war to Tomcat, move or copy the WAR to $TOMCAT_HOME/webapps/ or use the Tomcat Manager Application to upload and deploy the WAR. After the WAR is deployed (and your server is started), point your browser to

> http://localhost/showcase

Of course, if the server is not local, substitute the IP or hostname for "localhost", including a port designation if needed. If you are not deploying the Showcase application, then substitute the appropriate application name for "showcase"

Deploying the Examples

The framework build copies the sources of each bundled web application to dist/webapps/$APP. The build also compiles the sources for each appolication and creates a WAR at dist/webapps/$APP.war. However, these WAR files are NOT ready to be deployed. These WARs do not include any of the JAR files. (Omitting the JARS reduces the size of the download by almost 200mb.) To include the dependant JARs, run Ant in the dist/webapps directory, and new WARs, with all the JARs, are placed in dist/webapps/dist.

  • No labels