...
The full distribution can be downloaded form the Apache Struts website. The distribution contains the struts-action2.jar
file, a copy of all the documentation, sources, all required and optional dependencies,and example applications. For more information on how to build the framework from source or even from a clean checkout, please refer to Building the Framework from Source.
Browse the Resources
There are many online resources available. Here are links to help you find your way:
- Download SAF2 - download the framework distribution
- Join the Forums - The forums are full of active developers, contributors, and power users - often even available for chat. This is the best and quickest way to get a question answered.
- Subscribe to Mailing List and post a question, or browse Mail Archive. (You probably want to browse the archive or forum first. All posts from the forum are posted to the mailing lists, and vice versa.
- Subversion Repository - Browse the source.
- Confluence Wiki - Read it here first! The project documentation is created on the wiki and then posted as HTML to the website.
- JIRA Issue Tracker - Browse or file enhancements requests and defect reports.
- Apache Struts Home
Distribution Quickstart
The distribution contains the following directory layout:
No Format |
---|
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:
No Format |
---|
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. 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:
Code Block |
---|
> 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:
Code Block |
---|
> 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.
Note | ||
---|---|---|
| ||
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:
Code Block |
---|
> 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.
Code Block |
---|
> 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
Code Block |
---|
> 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"
Info | ||
---|---|---|
| ||
The framework build copies the sources of each bundled web application to |
Your First SAF2 Application
...