Web.xml the JSP page after configuring struts2 to report HTTP 404 error __js

Source: Internet
Author: User
Tags pack

To avoid having to do with HTTP 404 errors in the future, decide to write down every time you encounter this type of error in case of a query.

Because no struts2 before, can normal access to the application directory files, after configuration access to files are reported 404 errors, so determine is STRUTS2 configuration error, and then look up from the Internet, found that many people have a similar error, a lot of solutions, there are:

A. When visiting, the wrong URL was written;

B.web.xml configuration error, Filter-class has two ways of writing,  Say how many versions and then use Org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter instead It's org.apache.struts2.dispatcher.FilterDispatcher. As to which version after the switch, why changed, left to study later.

C. No struts jar packs were added. Add Jar pack, this question hey, before watching the screen struts2 is, the teacher is using a copy jar package and paste into the package-explorer view of the Lib, but previously all through the BuildPath to add the external jar package, as for the two effects are the same, The difference is what, this later.

D.jar package conflict. Speaking of this is really depressing, you say less can not understand it, this more than one also not, it seems should be summed up which jar pack easy conflict.

Follow the above methods to try each, and found that yes ah, the whole people are crazy, and finally decided to calm down to the beginning of the examination once again, not on hold. Later found that the Struts.xml configuration is more than one action, because it is directly from other projects directly to the Struts.xml so the original action also test came to know that the action is useless, I thought I do not access this action, there will be no problem. The result is the problem, then the extra action is removed and the access is successful.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.