2

This "struts.xml":

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

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

    <action name="Register" class="com.struts2.RegisterAction">
        <result name="input">/register.jsp</result>
        <result type="redirectAction">register.jsp</result>
    </action>

</package>


Works perfectly fine in Tomcat but always generates following error always in WAS 6.1:

" There is no Action mapped for namespace / and action name . - [unknown location]"

But if I modify the "struts.xml" like following then it works fine in WAS6.1:

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

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

    <action name="Register" class="com.struts2.RegisterAction">
        <result name="input">/register.jsp</result>
        <result type="redirectAction">register.jsp</result>
    </action>

</package>

<package name="default" namespace="/" extends="struts-default">
    <default-action-ref name="index" />
    <action name="index">
        <result type="redirectAction">
            <param name="actionName">Register</param>
            <param name="namespace">/register</param>                
        </result>
    </action>
</package>

I totally can't understand what is the reason. It's always looking for I believe the action name "index". Can anyone explain what the reason is?

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
SmoothCriminel
  • 367
  • 1
  • 7
  • 17

1 Answers1

0

I am not sure if this is the cause of the issue but I can't see where you have defined an action in your struts.xml called "register.jsp". The result type "redirectAction" is used to target a struts2 action. On input you do not specify a type so the default is assumed which is "dispatcher".

Change:

<result type="redirectAction">register.jsp</result>

with

<result>register.jsp</result>

Which assumes the request type is "dispatcher" (a jsp) and the name is "success".

Quaternion
  • 10,380
  • 6
  • 51
  • 102