Setting Up a Struts 2 Project
Site Admin
· 11 Sep 2026
· 4 views
Required JARs
A Struts 2 web app needs the core jars: struts2-core, xwork-core, ognl, freemarker, commons-fileupload, commons-io and commons-logging.

Web Project Steps
- Create a Dynamic Web Project in Eclipse.
- Add the Struts 2 jars to WEB-INF/lib.
- Configure web.xml with the Struts 2 filter.
- Create struts.xml in the classes/src folder.
- Write an Action class and JSP views.



web.xml Filter Mapping
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
Key Points
- Deploy the WAR to Tomcat and hit action URLs.
- struts.xml maps actions to classes and results.
- All jars belong under WEB-INF/lib.