How to configure Struts Framework to Eclipse
I would like to add the开发者_如何学Python struts framework to my eclipse helios j2ee version. Plese give me the guidance regarding this.
Thanks in advance.
- Create a new Java EE project in Eclipse.
- Download the Apache Struts framework from its website.
- If you use Maven as your build system, add the Structs artifact (see here). If you use another build system, unzip the downloaded framework and add these files to the
WEB_INF/lib
folder of your application:- commons-fileupload-X.X.X.jar
- commons-io-X.X.X.jar
- commons-logging-X.X.X.jar
- commons-logging-api.X.X.jar
- freemarker-X.X.X.jar
- ognl-X.X.X.jar
- struts2-core-X.X.X.X.jar
- xwork-core-X.X.X.jar
- javassist-3.7.ga.jar
Configure the Web application so that the Struts framework will handle all page requests by adding these lines to the
web.xml
file:<filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
Create the
struts.xml
configuration file.- Create the JSPs you need.
- Build the application.
Source (and further information): http://struts.apache.org/2.2.3/docs/create-struts-2-web-application-with-artifacts-in-web-inf-lib-and-use-ant-to-build-the-application.html
One more jar you need to add that is commons-lang3-x.x.jar
精彩评论