You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Lukasz Lenart (JIRA)" <ji...@apache.org> on 2010/01/11 09:29:44 UTC

[jira] Closed: (WW-3371) Problem in redirecting action in struts.xml

     [ https://issues.apache.org/struts/browse/WW-3371?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lukasz Lenart closed WW-3371.
-----------------------------

    Resolution: Not A Problem
      Assignee: Lukasz Lenart

Please ask question on Struts User Group [1] instead filling bug report. You can also check documentation first [2] [3] ,
'redirect' result is used to redirect to web resource not to anther action

[1] http://struts.apache.org/mail.html
[2] http://struts.apache.org/2.x/docs/result-types.html
[3] http://struts.apache.org/2.x/docs/redirect-action-result.html


Regards
--
Lukasz

> Problem in redirecting action in struts.xml
> -------------------------------------------
>
>                 Key: WW-3371
>                 URL: https://issues.apache.org/struts/browse/WW-3371
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.1.6
>         Environment: OS :: Windows XP SP2
> IDE:: MyEclipse 5.1
> J2EE 1.4
> jdk 1.6
> tomcat 6.0
>            Reporter: Hemrajsinh
>            Assignee: Lukasz Lenart
>            Priority: Blocker
>
> I found one problem when i was using "redirect" action in Struts2.
> My Struts.xml file is as follow>>>>
> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
> 	"http://struts.apache.org/dtds/struts-2.0.dtd">
> <struts>
> 	<package name="default" extends="struts-default">
> 		<action name="logIn">
> 			<result>userLogin.jsp</result>
> 		</action>
> 		<action name="addUser">
> 			<result>addUser.jsp</result>
> 		</action>
> 		<action name="manageUser" method="display"
> 			class="pck.ManageUser">
> 			<result name="success">manageUser.jsp</result>
> 		</action>
> 		<action name="deleteUser" class="pck.ManageUser"
> 			method="deleteUser">
> 			<result name="success" type="redirect">manageUser</result>
> 		</action>
> 		<action name="userVerify" class="pck.UserLoginAction"
> 			method="execute">
> 			<result name="success">WelcomeUser.jsp</result>
> 		</action>
> 		<action name="AddUserAction" class="pck.AddUserAction">
> 			<result name="success">firstPg.jsp</result>
> 		</action>
> 		<action name="UpdateUser" class="pck.ManageUser"
> 			method="updateOrSave">
> 			<result name="updated" type="redirect">manageUser</result>
> 		</action>
> 		<action name="editUser" method="displayForUpdate"
> 			class="pck.ManageUser">
> 			<result>updateUser.jsp</result>
> 		</action>
> 		<action name="deleteUser" method="deleteUser"
> 			class="pck.ManageUser">
> 			<result name="deleteSuccess" type="redirect">
> 				ManageUser.jsp
> 			</result>
> 		</action>
> 	</package>
> </struts>
> when i am using this file in my application tomcat gives following error>>>
> type Status report
> message No result defined for action pck.ManageUser and result success
> description The requested resource (No result defined for action pck.ManageUser and result success) is not available.
> And after many trials i found one solution for this problem.
> I just made one minor change in struts.xml file.
> I cut the action
> <action name="deleteUser" class="pck.ManageUser"
> 			method="deleteUser">
> 			<result name="success" type="redirect">manageUser</result>
> 		</action>
> and paste it at the end, which is as follow::
> Mdified struts.xml is>>>>>
> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
> 	"http://struts.apache.org/dtds/struts-2.0.dtd">
> <struts>
> 	<package name="default" extends="struts-default">
> 		<action name="logIn">
> 			<result>userLogin.jsp</result>
> 		</action>
> 		<action name="addUser">
> 			<result>addUser.jsp</result>
> 		</action>
> 		<action name="manageUser" method="display"
> 			class="pck.ManageUser">
> 			<result name="success">manageUser.jsp</result>
> 		</action>
> 		
> 		<action name="userVerify" class="pck.UserLoginAction"
> 			method="execute">
> 			<result name="success">WelcomeUser.jsp</result>
> 		</action>
> 		<action name="AddUserAction" class="pck.AddUserAction">
> 			<result name="success">firstPg.jsp</result>
> 		</action>
> 		<action name="UpdateUser" class="pck.ManageUser"
> 			method="updateOrSave">
> 			<result name="updated" type="redirect">manageUser</result>
> 		</action>
> 		<action name="editUser" method="displayForUpdate"
> 			class="pck.ManageUser">
> 			<result>updateUser.jsp</result>
> 		</action>
> 		<action name="deleteUser" method="deleteUser"
> 			class="pck.ManageUser">
> 			<result name="deleteSuccess" type="redirect">
> 				ManageUser.jsp
> 			</result>
> 		</action>
> 		
> 		<action name="deleteUser" class="pck.ManageUser"
> 			method="deleteUser">
> 			<result name="success" type="redirect">manageUser</result>
> 		</action>
> 	</package>
> </struts>
> Is this a problem of struts2?
> I don't know about this. I am just a beginner in Struts.
> If You find any solution please let me know.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.