Example Code for Struts 2 In Action

The following archived MyEclipse Web Projects provide the examples referenced in the Struts 2 In Action book.

To load one of the above examples into your MyEclipse workspace do the following

  1. Download and save the zip file to your computer
  2. In your MyEclipse workspace go to File Import - Existing Project Into Workspace (under general) - click next
  3. Click the radio button for Select Archive File and then browse to where you saved the zip file in step 1
  4. You should see the project name and then click on Finish

Now you can add the web project to run under your MyEclipse Tomcat server by following these steps

  1. Under Run - select Open run dialog
  2. Right click on the MyEclipse Server Application and select New
  3. Type in the run configuration name (I usually use the project name)
  4. In the project drop down select the project
  5. In the server drop down select MyEclipse Tomcat
  6. Select Apply and Run

MyEclipse will deploy the project to the MyEclipse tomcat webapps folder, start up tomcat, and launch the index.jsp page (which for the above example projects just forwards to the correct start page). In the future when you want to run the project, just click on the drop down arrow next to the run icon (the green circle with an arrow) and click on the name you gave the run configuration in step 3 above (usually the project name).