You can also customize the forward in your action class.

//forward to the appropriate view
ActionForward forward = new ActionForward();

forward.setPath("/newrequest/index.jsp");

StringBuffer path = new StringBuffer(forward.getPath());

boolean isQuery = (path.indexOf("?") >= 0);

if (isQuery)
        path.append("&parm1=value1");
        path.append("&parm2=value2");
else {
        path.append("?parm1=value1");
        path.append("&parm2=value2");
}

forward.setPath(path.toString());

//Set redirect
forward.setRedirect(true);

forward.setContextRelative(true);

return forward;


-----Original Message-----
From: Adam Hardy [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 07, 2003 5:46 AM
To: Struts Users Mailing List
Subject: Re: Redirect option instead of findForward!!!Urgent


I'd definitely upgrade to 1.1.0 but I don't know if it will help.

The request object cannot be passed with the redirect though - the 
redirect AFAIK is just a

<meta http-equiv="refresh" content="0; URL=http://blahblah";>

header, which goes out to the browser to tell it to send another new 
request.

In your position I would enumerate over the request properties at the 
beginning of your showPassword action, and log the output to verify that 
you are not getting those properties you don't want. Theoretically you 
should only have hidValue=N, unless you put them all in a cookie.

Adam


Anurag Garg wrote:
> Hi Adam,
> 
> I have already tried this option, but still it is giving me the same
> problem. This is how I have defined in the struts-config.
> 
> When i do mapping.findForward("showPassword") in my TestAC i am taken to
the
> correct page but the request object is also passed with it although i have
> set the redirect attribute as "true".
> 
>             <action path="/test" type="com.action.TestAC"
>               name="sourcingAF" scope="request" validate="false"
> input="/pages/Test.jsp">
>               <forward name="showLogout" path="/pages/Logout.jsp"/>
>               <forward name="showPassword"
path="/ShowPassword.do?hidValue=N"
> redirect="true" />
> 
> I am using the struts rc-2. Any problem with it.
> 
> 
> Anurag Garg
> 
> 
> -----Original Message-----
> From: Adam Hardy [mailto:[EMAIL PROTECTED]
> Sent: Thursday, August 07, 2003 1:35 PM
> To: Struts Users Mailing List
> Subject: Re: Redirect option instead of findForward!!!Urgent
> 
> 
> Hi Anurag,
> you specify in struts-config in the forward element for the action
> mapping, that it should redirect. (="true")
> 
> Adam
> 
> Anurag Garg wrote:
> 
>>Hello All,
>>
>>I have created a page where i submit the data for saving it in the
> 
> database.
> 
>>I have some hidden variables defined in the same page. After saving the
> 
> data
> 
>>when my control comes in the action class I do mapping.findForward to the
>>other page. The new page also contains some hidden variables which have
> 
> the
> 
>>same name as the previous page. When the new page's action class gets
>>executed the value of hidden variables from the previous page is picked as
>>the findforward is taking my request object to the other page. Now i dont
>>want my request object from the previous page to move to the new page. Is
>>there any option which can do response.sendRedirect for me so that i dont
>>take my request object of the previous page along to the new page. I have
>>tried to reset the variables in the action class before doing findforward
> 
> to
> 
>>the new page.
>>
>>Thanks for the response in advance
>>
>>Anurag Garg.
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to