You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by James MacKenzie <jm...@uk.ibm.com> on 2004/04/05 17:01:25 UTC

Calling one action from another - removing request parameters

Hi All,

I am having a small problem with Struts. If my application calls say 
something1.do?row=10 and the result of this calls another action servlet 
ie something2.do with no request parameters, something2Action is still 
able to see request.getParameter("row").

Does anyone know why is this happening and is there a way of fixing it?

Thanks!

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


Re: Calling one action from another - removing request parameters

Posted by Geeta Ramani <ge...@cmpco.com>.
James:

Why this happens is because you are proabably forwarding (rather than
redirecting) to Something2Action - so the request object is intact for your
second action.  So you can choose to redirect instead.. however be aware
that if you redirect, *everything* in the request object then will be lost
(like attributes you may have set).. Another way that should work is to
forward instead to say something2.do?row=-1

Regards,
Geeta

James MacKenzie wrote:

> Hi All,
>
> I am having a small problem with Struts. If my application calls say
> something1.do?row=10 and the result of this calls another action servlet
> ie something2.do with no request parameters, something2Action is still
> able to see request.getParameter("row").
>
> Does anyone know why is this happening and is there a way of fixing it?
>
> Thanks!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org


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


RE: Calling one action from another - removing request parameters

Posted by Robert Taylor <rt...@mulework.com>.
You are probably forwarding to something2Action. 
If you redirect to something2Action, then the query parameters
will have been removed from memory.

robert

> -----Original Message-----
> From: James MacKenzie [mailto:jmackenz@uk.ibm.com]
> Sent: Monday, April 05, 2004 11:01 AM
> To: user@struts.apache.org
> Subject: Calling one action from another - removing request parameters
> 
> 
> Hi All,
> 
> I am having a small problem with Struts. If my application calls say 
> something1.do?row=10 and the result of this calls another action servlet 
> ie something2.do with no request parameters, something2Action is still 
> able to see request.getParameter("row").
> 
> Does anyone know why is this happening and is there a way of fixing it?
> 
> Thanks!
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

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


RE: Calling one action from another - removing request parameters

Posted by Daniel Perry <d....@netcase.co.uk>.
If you forward between actions without actually redirecting the browser,
then the parameters remain intact!

If you set redirect to true, then the request will be redirected at the
browser level, and parameters will be cleared.

Daniel.

-----Original Message-----
From: James MacKenzie [mailto:jmackenz@uk.ibm.com]
Sent: 05 April 2004 16:01
To: user@struts.apache.org
Subject: Calling one action from another - removing request parameters


Hi All,

I am having a small problem with Struts. If my application calls say
something1.do?row=10 and the result of this calls another action servlet
ie something2.do with no request parameters, something2Action is still
able to see request.getParameter("row").

Does anyone know why is this happening and is there a way of fixing it?

Thanks!

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



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


RE: Calling one action from another - removing request parameters

Posted by Guillermo Meyer <gm...@interbanking.com.ar>.
If the problem is that somethingAction2 sees row parameter, you have to
send a redirect when calling action2. You can set redirect="true" in the
forward. Request parameters cant be deleted during request life cicle.
When sending a redirect, a new request is generated, so original request
paramenters wont be in the new one.

Cheers.
Guillermo.

-----Original Message-----
From: James MacKenzie [mailto:jmackenz@uk.ibm.com] 
Sent: Lunes, 05 de Abril de 2004 12:01 p.m.
To: user@struts.apache.org
Subject: Calling one action from another - removing request parameters


Hi All,

I am having a small problem with Struts. If my application calls say 
something1.do?row=10 and the result of this calls another action servlet

ie something2.do with no request parameters, something2Action is still 
able to see request.getParameter("row").

Does anyone know why is this happening and is there a way of fixing it?

Thanks!

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

NOTA DE CONFIDENCIALIDAD
Este mensaje (y sus anexos) es confidencial, esta dirigido exclusivamente a las personas direccionadas en el mail y puede contener informacion (i)de propiedad exclusiva de Interbanking S.A. o (ii) amparada por el secreto profesional. Cualquier opinion en el contenido, es exclusiva de su autor y no representa necesariamente la opinion de Interbanking S.A. El acceso no autorizado, uso, reproduccion, o divulgacion esta prohibido. Interbanking S.A no asumira responsabilidad ni obligacion legal alguna por cualquier informacion incorrecta o alterada contenida en este mensaje. Si usted ha recibido este mensaje por error, le rogamos tenga la amabilidad de destruirlo inmediatamente junto con todas las copias del mismo, notificando al remitente. No debera utilizar, revelar, distribuir, imprimir o copiar este mensaje ni ninguna de sus partes si usted no es el destinatario. Muchas gracias.



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