Struts v2.3.8 Integration

Description

This samples demonstrates Struts 2 Web framework integration through a simple phonebook Web application deployed to Liberty.

The samples uses Struts 2.x as the model-view-control framework for presentation logic and Spring as the IoC container to inject a bean into a Struts 2 action.

This sample can be installed onto runtime versions 8.5.5.0 and later.

Instructions

  1. Install the packaged server by typing 'java -jar Struts2Sample.jar' and following the instructions.
  2. Start the Struts2Sample server by running the command 'bin/server run Struts2Sample' from the root of the Liberty profile installation, and confirm the application started by looking in the console output":
    CWWKZ0001I: Application PhoneBookByStruts2 started in XX.XX seconds.
  3. In your browser, enter the URL for the application: http://localhost:9114/PhoneBookByStruts2/ (where port 9114 assumes the httpEndpoint provided in the sample server.xml has not been modified).
  4. In your browser, you should see the phone book displayed.

Notes

This sample does not include the open source dependencies. The installer will provide a list of the open source pre-requisite libraries and where they can be downloaded from. To help obtaining these libraries, the installer provides the option to download them on your behalf.

Sample Structure

  • wlp
    • usr
      • servers
        • Struts2Sample
          • Copyright.txt
          • apps
            • PhoneBookByStruts2-1.0.0.war
          • lafiles
            • LA_en
            • LI_en
          • readme.html
          • server.xml
      • shared
        • config
          • Struts2SampleLibs.xml
        • resources
          • Struts2SampleLibs
            • aopalliance-1.0.jar
            • asm-3.3.jar
            • asm-commons-3.3.jar
            • asm-tree-3.3.jar
            • commons-fileupload-1.2.2.jar
            • commons-io-2.0.1.jar
            • commons-lang3-3.1.jar
            • commons-logging-1.1.1.jar
            • freemarker-2.3.19.jar
            • javassist-3.11.0.GA.jar
            • ognl-3.0.6.jar
            • spring-aop-3.0.5.RELEASE.jar
            • spring-asm-3.0.5.RELEASE.jar
            • spring-beans-3.0.5.RELEASE.jar
            • spring-context-3.0.5.RELEASE.jar
            • spring-core-3.0.5.RELEASE.jar
            • spring-expression-3.0.5.RELEASE.jar
            • spring-web-3.0.5.RELEASE.jar
            • struts2-api-2.0.5.jar
            • struts2-core-2.3.8.jar
            • struts2-spring-plugin-2.3.8.jar
            • xwork-core-2.3.8.jar

External Dependencies

The table below shows the dependencies that are required for: Struts 2.x sample shared libraries..

Target install path Source URL
shared/resources/Struts2SampleLibs/spring-beans-3.0.5.RELEASE.jar http://search.maven.org/remotecontent?filepath=org/springframework/spring-beans/3.0.5.RELEASE/spring-beans-3.0.5.RELEASE.jar
shared/resources/Struts2SampleLibs/spring-core-3.0.5.RELEASE.jar http://search.maven.org/remotecontent?filepath=org/springframework/spring-core/3.0.5.RELEASE/spring-core-3.0.5.RELEASE.jar
shared/resources/Struts2SampleLibs/spring-aop-3.0.5.RELEASE.jar http://search.maven.org/remotecontent?filepath=org/springframework/spring-aop/3.0.5.RELEASE/spring-aop-3.0.5.RELEASE.jar
shared/resources/Struts2SampleLibs/spring-web-3.0.5.RELEASE.jar http://search.maven.org/remotecontent?filepath=org/springframework/spring-web/3.0.5.RELEASE/spring-web-3.0.5.RELEASE.jar
shared/resources/Struts2SampleLibs/spring-context-3.0.5.RELEASE.jar http://search.maven.org/remotecontent?filepath=org/springframework/spring-context/3.0.5.RELEASE/spring-context-3.0.5.RELEASE.jar
shared/resources/Struts2SampleLibs/spring-asm-3.0.5.RELEASE.jar http://search.maven.org/remotecontent?filepath=org/springframework/spring-asm/3.0.5.RELEASE/spring-asm-3.0.5.RELEASE.jar
shared/resources/Struts2SampleLibs/spring-expression-3.0.5.RELEASE.jar http://search.maven.org/remotecontent?filepath=org/springframework/spring-expression/3.0.5.RELEASE/spring-expression-3.0.5.RELEASE.jar
shared/resources/Struts2SampleLibs/commons-logging-1.1.1.jar http://search.maven.org/remotecontent?filepath=commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar
shared/resources/Struts2SampleLibs/aopalliance-1.0.jar http://search.maven.org/remotecontent?filepath=aopalliance/aopalliance/1.0/aopalliance-1.0.jar
shared/resources/Struts2SampleLibs/struts2-core-2.3.8.jar http://search.maven.org/remotecontent?filepath=org/apache/struts/struts2-core/2.3.8/struts2-core-2.3.8.jar
shared/resources/Struts2SampleLibs/xwork-core-2.3.8.jar http://search.maven.org/remotecontent?filepath=org/apache/struts/xwork/xwork-core/2.3.8/xwork-core-2.3.8.jar
shared/resources/Struts2SampleLibs/asm-3.3.jar http://search.maven.org/remotecontent?filepath=asm/asm/3.3/asm-3.3.jar
shared/resources/Struts2SampleLibs/asm-commons-3.3.jar http://search.maven.org/remotecontent?filepath=asm/asm-commons/3.3/asm-commons-3.3.jar
shared/resources/Struts2SampleLibs/asm-tree-3.3.jar http://search.maven.org/remotecontent?filepath=asm/asm-tree/3.3/asm-tree-3.3.jar
shared/resources/Struts2SampleLibs/freemarker-2.3.19.jar http://search.maven.org/remotecontent?filepath=org/freemarker/freemarker/2.3.19/freemarker-2.3.19.jar
shared/resources/Struts2SampleLibs/ognl-3.0.6.jar http://search.maven.org/remotecontent?filepath=ognl/ognl/3.0.6/ognl-3.0.6.jar
shared/resources/Struts2SampleLibs/javassist-3.11.0.GA.jar http://search.maven.org/remotecontent?filepath=javassist/javassist/3.11.0.GA/javassist-3.11.0.GA.jar
shared/resources/Struts2SampleLibs/commons-fileupload-1.2.2.jar http://search.maven.org/remotecontent?filepath=commons-fileupload/commons-fileupload/1.2.2/commons-fileupload-1.2.2.jar
shared/resources/Struts2SampleLibs/commons-io-2.0.1.jar http://search.maven.org/remotecontent?filepath=commons-io/commons-io/2.0.1/commons-io-2.0.1.jar
shared/resources/Struts2SampleLibs/struts2-api-2.0.5.jar http://search.maven.org/remotecontent?filepath=org/apache/struts/struts2-api/2.0.5/struts2-api-2.0.5.jar
shared/resources/Struts2SampleLibs/struts2-spring-plugin-2.3.8.jar http://search.maven.org/remotecontent?filepath=org/apache/struts/struts2-spring-plugin/2.3.8/struts2-spring-plugin-2.3.8.jar
shared/resources/Struts2SampleLibs/commons-lang3-3.1.jar http://search.maven.org/remotecontent?filepath=org/apache/commons/commons-lang3/3.1/commons-lang3-3.1.jar

Support Information

For further information and resources for developers using IBM WebSphere Application Server, please visit wasdev.net.

Licensed Materials - Property of IBM © Copyright IBM Corp. 1997, 2013. All Rights Reserved. IBM, and the IBM logo are trademarks or registered trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at Copyright and trademark information.