sunleo
sunleo

Reputation: 10947

WARNING: No configuration found for the specified action:

I am getting following exception, please help to solve this issue.

Jul 16, 2013 11:18:40 AM org.apache.struts2.components.Form evaluateExtraParamsServletRequest
WARNING: No configuration found for the specified action: `'HelloWorld1'` in namespace: `''`. Form action defaulting to 'action' attribute's literal value.

index.jsp:

<s:form action="HelloWorld1" namespace="/" method="post" >
            <s:textfield name="userName" label="User Name" />
            <s:submit />
</s:form>

struts.xml:

<package name="default" namespace="/" extends="struts-default" >
    <action name="HelloWorld1" class="java.vaannila.HelloWorld">
        <result name="SUCCESS">/success.jsp</result>
    </action>
</package>

HelloWorld .java:

public class HelloWorld extends ActionSupport{
       //execute method
   }

Upvotes: 4

Views: 33045

Answers (3)

Muhammad Kashif Nazar
Muhammad Kashif Nazar

Reputation: 23825

If you are sure that the configurations are being loaded properly, try removing the namespace attribute or setting namespace="" instead of namespace="/".

Upvotes: 2

Roman C
Roman C

Reputation: 1

This warning appears only when you use devMode. Turn it off and it should disappear, add the following to the struts.xml

<constant name="struts.devMode" value="false"/> 

Upvotes: 0

Ravi K Thapliyal
Ravi K Thapliyal

Reputation: 51711

The error suggests that Struts 2 couldn't load your XML configuration. Make sure your struts.xml is inside WEB-INF/classes directory. (The rest of the configuration looks fine.)

Upvotes: 2

Related Questions