STRUTS2 Configuration Error There is no action mapped for namespace [/] and Action name [] associated with context

Source: Internet
Author: User

Today, I encountered this problem when I was using STRUTS2.

Struts have detected an unhandled exception:

Messages:
  • There is no action mapped for namespace [/] and Action name [] associated with context path [/SSM1].
  • The Struts.xml file at this time is as follows:
    <?xml version= "1.0" encoding= "UTF-8"? ><! DOCTYPE struts public    "-//apache software foundation//dtd strutsconfiguration 2.3//en"    "/HTTP/ Struts.apache.org/dtds/struts-2.0.dtd "><struts><constant name=" Struts.enable.DynamicMethodInvocation "value=" false "/><constant name=" Struts.devmode "value=" true "/>< Constant Name= "struts.objectfactory" value= "Spring"/>    <package name= "Default" namespace= "/" extends= " Struts-default ">        <!--Note: Here's class--        <action name=" student_* "class=" studentaction "method=" {1 } ">        <result name=" add_success ">/add_success.jsp</result>        </action>    </ Package></struts>
    Solution:
    <?xml version= "1.0" encoding= "UTF-8"? ><! DOCTYPE struts public    "-//apache software foundation//dtd struts Configuration 2.0//en"    "/http Struts.apache.org/dtds/struts-2.0.dtd "><struts><constant name=" Struts.enable.DynamicMethodInvocation "value=" false "/><constant name=" Struts.devmode "value=" true "/>< Constant Name= "struts.objectfactory" value= "Spring"/>    <package name= "Default" namespace= "/" extends= "< Span style= "Background-color:rgb (255, 255, 0); >struts-default</span> >        <!--Note: Here's class--        <action name= "student_*" class= " Studentaction "method=" {1} ">        <result name=" add_success ">/add_success.jsp</result>        </ Action>    </package></struts>

    So, pay more attention to the configuration items in the Struts.xml, the key points of detail, must be handled well.


    Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

    STRUTS2 Configuration Error There is no action mapped for namespace [/] and Action name [] associated with context

    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.