The Bootstrap tutorial walks through installing the framework and creating a simple application.
While the framework is simple to use, creating non-trivial applications assumes a working knowledge of many JEE technologies, including:
- Filters, JSP, and Tag Libraries
- HTML and HTTP
- Web Containers (such as Tomcat)
For more about supporting technologies, see the Key Technologies Primer.
In the Ready, Set, Go! lesson, we download the framework and get started on an application of our own.
Download the Distribution
A distribution can be downloaded from the Apache Struts website. The full distribution contains the
struts2-core.jar file,related dependencies, example applications, a copy of the documentation in HTML format, and the complete source code.
To compile it yourself, refer to Building the Framework from Source.
Our First Application
To get started with a new application, we can use the blank template, run the Maven archetype, or set up a web infrastructure from scratch.
Using the Blank Application
The blank web application in the distribution's
apps directory is meant as a template. We can make a copy of the "blank.war", deploy it to our container, and use the exploded copy as the basis for our application. There is even a simple batch file in the source code directory that we can use to recompile the application in place.
Run the Maven Archetype
For those of us using Maven as a build system, we can use the Maven Archetype to create a new application.
For directions on using the Struts 2 archetypes see the Struts 2 Maven Archetypes page.
Setting up from scratch
If for some reason the blank template or archetype doesn't work out, it's not so hard to setup a Struts 2 application from scratch. For details, see Simple Setup.