WARNING: No configuration found for the specified action: in namespace: Form action defaulting to 'action' attribute's literal value

StackOverflow https://stackoverflow.com/questions/20641441

I am trying to find the namespace and action name with wildcards but it gets failed.

Exception :

WARNING: No configuration found for the specified action: '/checkMethods/executeCRUD' in namespace: ''. Form action defaulting to 'action' attribute's literal value.

XML :

<package name="crudAction" namespace="/checkMethods" extends="struts-default" >
    <action name="*CRUD" class="leo.struts.HelloWorldAction" method="{1}">
        <result name="success" >/crud.jsp</result>
    </action>       
</package>

JSP:

<body>
    Action so Far : <s:property value="message"/>
        <s:form action="/checkMethods/deleteCRUD" >            
            <s:submit label="delete"/>
        </s:form>
        <s:form action="/checkMethods/selectCRUD" >            
            <s:submit label="select"/>
        </s:form>
        <s:form action="/checkMethods/updateCRUD" >            
            <s:submit label="update"/>
        </s:form>
        <s:form action="/checkMethods/executeCRUD" >            
            <s:submit label="execute"/>
        </s:form>
    </body>
有帮助吗?

解决方案

In the action attribute you should specify the action name without slashes. Like

<s:form namespace="/checkMethods" action="deleteCRUD" > 

That would resolve action mappings but it will not save you from updating data.

Having multiple forms on the page separate the input fields by the s:form tag.

If you want to have several buttons mapped to each own action that operate on the same data then you should create one form and several submit tags, and each tag map to the method or action attribute.

See this answer how to do it.

the submit buttons should include method attribute to call corresponding methods of the action

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top