struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Al Sutton" ...@al-and-andrea.org.uk>
Subject [s2] Problem with <result> in 2.0.6
Date Sun, 29 Apr 2007 07:54:28 GMT
Hi,

I've got what seems to be strange behaviour which I've tried to find the
reason for, but can't seem to find an explanation. The struts.xml is at the
end of the email, I'll describe the problem first in case it rings any
bells.

In a nutshell it seems that using any result type other than redirect for
actions generates a 404 error message, whereas if I use a redirect it works.

My specific situation is that I'm running using Tomcat 5.5.23 inside of
Eclipse 3.2.2 and I have a JSP with an s:form which POSTs to the an action
located at /VerifyLogin. /VerifyLogin forwards the user an action at
/eds/Welcome, which in turn can forward the user to an action at
/eds/ForceChangeLoginPassword. If I change the result type for VerifyLogin
from a redirect to the default (i.e. remote the type attribute of the result
tag) I get a 404, if I use a type of redirect it works (correctly forwards,
no 404). The same is true for the redirect for /eds/Welcome to
/eds/ForceChangeLoginPassword, if I use <result type="redirect"> it works
and I don't I get a 404.

The two questions I have are;

1) Is the expected behaviour?

2) Is there any reason why, if this is normal, the struts.xml parser
couldn't determine which forwards go to actions and set their default to
redirect, or produce a warning that the configuration won't work?

Thanks for any help,

Al.




struts.xml:

<!DOCTYPE struts PUBLIC 
	"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
	"http://struts.apache.org/dtds/struts-2.0.dtd">
	
<struts>
    <constant name="struts.devMode" value="true" />

	<include file="struts-default.xml"/>

	<package name="net.enterprisedatasafe.servlets.unrestricted"
extends="struts-default" namespace="/">
		<action	name="VerifyLogin" 
	
class="net.enterprisedatasafe.servlets.unrestricted.VerifyLogin" >
			<result type="redirect">/eds/Welcome.action</result>
			<result
name="passwordsync">/passwordsync.jsp</result>
			<result name="error">/index.jsp</result>
		</action>
	</package>

	<package name="net.enterprisedatasafe.servlets.restricted"
extends="struts-default" namespace="/eds">
		<action	name="Welcome" 
	
class="net.enterprisedatasafe.servlets.restricted.Welcome" >
			<result>/eds/Explorer</result>
			<result
name="display_expiring_passwords">/eds/ExpiringPasswords</result>
			<result
name="forced_password_change">/eds/ForceChangeLoginPassword.action</result>
		</action>

		<action	name="ForceChangeLoginPassword" 
	
class="net.enterprisedatasafe.servlets.restricted.ForceChangeLoginPassword"
>
	
<result>/eds/forced_update_login_password.jsp</result>
		</action>
	</package>
 </struts> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message