Building a Struts2 Application

  1. Create new maven maven-archetype-webapp project with the name strutsapp.
  2. Rename the JavaR esources/src/main/resources directory to Java Resources/src/main/java
  3. Replace the web.xml file with this one.
  4. Replace the pom.xml file with this one. In your project's file org.eclipse.wst.common.project.facet.core.xml make sure facet="jst.web" version="2.4. Then run maven update command. This should clear any project errors.
  5. In Java Resources/src/main/java create a file named struts.xml and then replace it with this one.
  6. In Java Resources/src/main/java create a file named log4j2.xml and then replace it with one. Make sure to update the file path in the file to your own user direction
  7. In Deployed Resources/webapp/web-inf create the directory jsp/welcome
  8. In Deployed Resources/webapp/web-inf/jsp/welcome directory create two files named hello.jsp and default-action.jsp and replace hello.jsp with this one and default-action.jsp with this one.
  9. In Deployed Resources/webapp directory create the file named index.jsp and replace index.jsp with this one.
  10. Run the command http://localhost:8080/strutsapp and you should see Hello World which is the index.jsp file
  11. Run the command http://localhost:8080/strutsapp/default-action and you should see default-action.jsp for COMP 3601 which is the default-action.jsp file
  12. Run the command http://localhost:8080/strutsapp/hello and you should see Hello.jsp for COMP 3601 which is the hello.jsp file
  13. Make sure you understand how everything connects and explain to me in order to get your mark.