2

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>
Roman C
  • 49,761
  • 33
  • 66
  • 176
sunleo
  • 10,589
  • 35
  • 116
  • 196

1 Answers1

1

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

Roman C
  • 49,761
  • 33
  • 66
  • 176
  • Thanks for reply,pls help me to understand.then how to call using normal form
    here how to call the namespace ?.
    – sunleo Dec 17 '13 at 18:10
  • In the HTML form you have to build URL manually, if you don't know the syntax you should check the source code generated in the browser. url tag could be useful. – Roman C Dec 17 '13 at 18:15
  • YES thanks , first i removed `.action` extension from `action="deleteCRUD.action"` and i added the namespace i think the attribute namespace required is that correct ? – shareef Feb 27 '14 at 18:38
  • @shareef What do you think about namespace? It's correct, but not related to the question as to be a thin thing regarding the action mapping well answered in some other of my answers. – Roman C Feb 27 '14 at 22:00