Search code examples
jspstrutsstruts-1struts-config

What is wrong with this struts-config.xml?


Getting the following error : java.lang.NullPointerException: Module 'null' not found.

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


    <struts-config>

        <form-beans>
            <form-bean name="RegistrationForm" type="com.testapp.actionform.RegistrationForm" />
        </form-beans>

        <global-exceptions>
        </global-exceptions>

        <global-forwards>
        </global-forwards>

        <action-mappings>

            <action path="/Registration" type="com.testapp.action.RegistrationAction" name="RegistrationForm"   scope="request" validate="false" input="index.jsp" >
                <forward name="success" path="/pages/RegistrationSuccess.jsp" />
            </action>

        </action-mappings>

        <message-resources parameter="resources.Application" />

    </struts-config>

Solution

  • Do you have the servlet mapping setup in the web.xml

        <servlet>
        <servlet-name>action</servlet-name>
        <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
        <init-param>
            <param-name>config</param-name>
            <param-value>/WEB-INF/struts-config.xml</param-value>           
        </init-param>
    

    1

    see the section on "configuring your application for modules" in the docs