Eclipse builds Struts2 environment
1. Create a Dynamic Web project. Dynamic.
2, copy the jar package.
Unzip the empty application in the Struts-2.3.20/apps.
Put the jar bag inside the Web-inf/lib
Into the lib of Eclipse.
After you copy it in:
3. Modify the Web. xml file
Default: (Note the previous version created in 1, 3.1, so this must also be 3.1)
Enter the app Struts2-blank inside, need the Web. XML inside the
Copy these into the Eclipse Project's Web. XML, before the <welcome-file-list> can not.
After the modification is complete:
4. Copy struts.xml configuration file:
Enter the web-inf/classes inside the apps empty app. You can see the Struts.xml file.
Copy it to SRC in the Eclipse project:
Struts.xml content is as follows:
To remove the temporary useless, change to the following form:
5. Create a JSP file:
Create a JSP file.
6. Operation:
Right-click hello.jspand select Run Onserver inside Run as.
Tomcat starts normally:
Inline browser browsing, content is displayed properly.
The results of the Firefox browser run are as follows:
At this point, a simple Struts2 environment is built.
Eclipse Builds STRUTS2 Environment