Struts 2.2.1 gives There is no Action mapped for namespace / and action name

struts2

I've got a simple Struts 2 application that I build and deploy to glassfish with Netbeans. When I point the web browser to http://localhost:8080/Struts2Hello/login.action/ it gives this error:

There is no Action mapped for namespace / and action name .

My action is named "login". Why does it think it is named "."?

(In order to get this far I've also had to add the javassist-3.7.ga to my lib/ directory. I'm not sure why, but that's what others have done to make Struts 2.2 work.)

Here's my web.xml and struts.xml files (yes, the struts.xml gets deployed to WEB-INF/classes):

<filter-name>struts2</filter-name>
    <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
    <filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
    <welcome-file>Login.jsp</welcome-file>
</welcome-file-list>

<package name="default" extends="struts-default" namespace="/">

    <action name="login" class="action.LoginAction">
        <result name="success">Welcome.jsp</result>
        <result name="error">Login.jsp</result>

    </action>
</package>

Thanks.

Dean

Best Answer

My problem was that I had the .jsp files in the WEB-INF/ dir instead of one level higher. Strange error message for that problem, though.

Related Topic