struts2.xml – can’t include other .xml file

I am using struts2, for that my struts.xml file contains code like :

<?xml version="1.0" encoding="UTF-8" ?>

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

<include file="strutsAuthentication.xml"/>

<package name="default" extends="struts-default">
    <interceptors>
        <interceptor-stack name="crudStack">
            <interceptor-ref name="checkbox" />
            <interceptor-ref name="params" />
            <interceptor-ref name="static-params" />
            <interceptor-ref name="defaultStack" />
        </interceptor-stack>
    </interceptors>
</package>

And i have specified all the required actions inside the strutsAuthentication.xml. That code is :

<struts>
<package name="authentication" extends="default" namespace="/authentication">
    <action name="saveCountry" class="saveCountryAction">
        <interceptor-ref name="defaultStack" />
        <result name="success">/savecountry.jsp</result>
        <result name="error">/error.jsp</result>
    </action>

</package>

When i am deploying my application into tomcat, it gives me warning that :

WARN (org.apache.struts2.components.Form:308) – No configuration found for the specified action: ‘saveCountry’ in namespace: ”. Form action defaulting to ‘action’ attribute’s literal value.

It means struts.xml can’t include strutsAuthentication.xml. Anyone have a solution ?? Thanx in advance….

Answer

Got d solution…. For above problem i was done a mistake in calling the action from jsp page. So namespace name “authentication” should be included at the time of calling the action class. Final solution is : “authentication/saveCountry.action”.

Leave a Reply

Your email address will not be published. Required fields are marked *