About STRUTS2 Basic cases there are always 404 wrong solutions
First I was a little white, recently in contact with the struts2 frame. In the learning process of watching video, there is a 404 problem. I follow the video on the basis of the case, the data are the same, when I run the time there are always 404 errors, make me very anxious. Then I found a lot of information on the Internet to find that it was not the problem of the code, but that there was a problem in building the project. When building a Web project, there will be a Dynamic Web module version, the default is to choose version 3.0, but should be selected 2.5, my tomcat is 7.0. Re-build the Web project, choose the correct version of the problem is solved.
Then I summed up a few easy to lead to 404 error places, for your reference:
1. In the configuration file, the extends= "Struts-default" property of the package tag is correct, which is fixed. Also note that the Name property of the action tag matches the names you access.
2.struts2 configuration file name and location is fixed, the name is Struts.xml, location in the SRC directory.
3. In the Web-inf directory, the Web. XML configuration file must be careful to see if the interceptor is configured.
This is my summary of the easy to make a few mistakes, I hope to be able to help small white like me.