开发者

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.


  1. Create a new Java EE project in Eclipse.
  2. Download the Apache Struts framework from its website.
  3. 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
  4. 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>
    
  5. Create the struts.xml configuration file.

  6. Create the JSPs you need.
  7. 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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜