Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Code Block
/tutorial/
/tutorial/META-INF/
/tutorial/WEB-INF/
/tutorial/WEB-INF/classes/struts.xml
/tutorial/WEB-INF/lib/
/tutorial/WEB-INF/lib/minimum JARs + any plugin JARs + plugin dependencies
/tutorial/WEB-INF/web.xml
  • Copy to your webapp/lib directory
    • the required JARs (see next section),
    • any Struts plugin JARs,
    • any plugin dependenckiesdependencies.
Tip

To customize the Struts templates (how HTML is rendered from the tags), copy into the application's webapp directory the framework's /src/java/template directory.

...

Filename

Description

struts2-core.jar

Framework library itself, found in distribution root directory

struts2-api.jar

Framework API library, found in distribution root directory

xwork.jar

XWork 2 library on which Struts 2 is built (version 2.0 or later)

ognl.jar

Object Graph Navigation Language (OGNL), the expression language used throughout the framework

javassist.jar

Java bytecode manipulation library used by OGNL

freemarker.jar

All UI tag templates are written in Freemarker (also a good option for your own views)

commons-logging.jar

Commons logging, which the framework uses to support transparently logging to either Log4J or JDK 1.4+

commons-fileupload.jar

The Commons FileUpload package makes it easy to add robust, high-performance, file upload capability to your servlets and web applications.

commons-io.jar

Commons IO is a library of utilities to assist with developing IO functionality.

commons-lang3.jar

Commons Lang3 is used to simplify usage of common tasks and code shortcuts to to stay DRY

web.xml

Java web application configuration file that defines the filters (and other components) for your web application

struts.xml

Framework configuration file that defines the actions, results, and interceptors for your application

...

Setup the Web Application Deployment Descriptor (web.xml)

Wiki MarkupCreate an {{web.xml}} file in {{\[webapp\]/WEB-INF}} (or merge into it the framework resources).

Code Block
titleweb.xml
<?xml version="1.0"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
  <display-name>My Application</display-name>
  <filter>
    <filter-name>struts2</filter-name>
    <filter-class>org.apache.struts2.dispatcher.FilterDispatcher<ng.filter.StrutsExecuteFilter</filter-class>
  </filter>

  <filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
</web-app>

...