When Struts2 is used, There is no Action mapped for namespace/and ac appears.

Source: Internet
Author: User

Today, when using Struts2, the running always prompts There is no Action mapped for namespace/and action name.
According to the prompt, it can be determined that such action does not exist in the namespace.
However, the configuration is correct after careful check.
After judging Struts. xml and web. xml one by one, the content of web. xml is as follows:
[Html]
<? Xml version = "1.0" encoding = "UTF-8"?> Www.2cto.com
<Web-app xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance"
Xmlns = "http://java.sun.com/xml/ns/javaee" xmlns: web = "http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
Xsi: schemaLocation = "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
Id = "WebApp_ID" version = "2.5">
<Display-name> 8.1 </display-name>
<Welcome-file-list>
<Welcome-file> index.html </welcome-file>
<Welcome-file> index.htm </welcome-file>
<Welcome-file> index. jsp </welcome-file>
<Welcome-file> default.html </welcome-file>
<Welcome-file> default.htm </welcome-file>
<Welcome-file> default. jsp </welcome-file>
</Welcome-file-list>
<Filter>
<Filter-name> struts2 </filter-name>
<Filter-class> org. apache. struts2.dispatcher. ng. filter. StrutsPrepareAndExecuteFilter </filter-class>
</Filter>
<Filter-mapping>
<Filter-name> struts2 </filter-name>
<Url-pattern>/* </url-pattern>
</Filter-mapping>
</Web-app>
In the project, there is no page defined by these elements under welcom-file-list. Therefore, after running the project in Eclipse directly, the page cannot be found and an error is prompted.
After being modified to the corresponding welcom-file, the operation is correct.

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.