You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by sudip shrestha <su...@gmail.com> on 2005/03/14 15:17:02 UTC

forward

I have certain situations when I have to forward the web page upon
success to a certaion action or to a page with url such that it has a
query string with it: e.g.:
"/actions/myActionxx.do?wId=123" or "/pages/myPagexx.do?wId=123"

Now, I can't provide the query strings with ids in struts-config.xml
file as the ids change depending upon the situation. So was wondering
if there was any other way around to it?

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


Re: forward

Posted by Hubert Rabago <hr...@gmail.com>.
Right.  The version in SVN is specifically for 1.3, which restores
ResponseUtils and puts TagUtils into a separate jar file.  That is why
it is written up that way.  Since you're using an  earlier version,
you can apply the changes you mentioned to your local copy of it, then
discard the whole class when you decide to move to 1.3.

Hubert

On Wed, 16 Mar 2005 16:34:23 -0600, sudip shrestha <su...@gmail.com> wrote:
> The ActionRedirect Class works great..Except one minor modification
> has to be made under function public void addParameter(String
> fieldName, Object valueObj):
> instead of value = ResponseUtils.encodeURL(value);
> use the following: value = TagUtils.getInstance().encodeURL(value);
> First of all ResponseUtils does not have any such method as
> encodeURL().  It is RequestUtils that has this method which is
> deprecated after Struts 1.2.
> 
> On Mon, 14 Mar 2005 10:07:13 -0600, Hubert Rabago <hr...@gmail.com> wrote:
> > You can create a new ActionForward object, copy the data from the
> > original forward, and modify the path of the new object.
> > A quick way would be to add the ActionRedirect class to your code and use that:
> > http://svn.apache.org/viewcvs.cgi/struts/core/trunk/src/share/org/apache/struts/action/ActionRedirect.java?rev=153901&view=markup
> > Usage examples are given in the javadoc.
> >
> > Hubert
> >
> > On Mon, 14 Mar 2005 08:17:02 -0600, sudip shrestha <su...@gmail.com> wrote:
> > > I have certain situations when I have to forward the web page upon
> > > success to a certaion action or to a page with url such that it has a
> > > query string with it: e.g.:
> > > "/actions/myActionxx.do?wId=123" or "/pages/myPagexx.do?wId=123"
> > >
> > > Now, I can't provide the query strings with ids in struts-config.xml
> > > file as the ids change depending upon the situation. So was wondering
> > > if there was any other way around to it?
> > >
> > > ---------------------------------------------------------------------
> > > 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
> >
> >
>

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


Re: forward

Posted by sudip shrestha <su...@gmail.com>.
The ActionRedirect Class works great..Except one minor modification
has to be made under function public void addParameter(String
fieldName, Object valueObj):
instead of value = ResponseUtils.encodeURL(value);
use the following: value = TagUtils.getInstance().encodeURL(value);
First of all ResponseUtils does not have any such method as
encodeURL().  It is RequestUtils that has this method which is
deprecated after Struts 1.2.


On Mon, 14 Mar 2005 10:07:13 -0600, Hubert Rabago <hr...@gmail.com> wrote:
> You can create a new ActionForward object, copy the data from the
> original forward, and modify the path of the new object.
> A quick way would be to add the ActionRedirect class to your code and use that:
> http://svn.apache.org/viewcvs.cgi/struts/core/trunk/src/share/org/apache/struts/action/ActionRedirect.java?rev=153901&view=markup
> Usage examples are given in the javadoc.
> 
> Hubert
> 
> On Mon, 14 Mar 2005 08:17:02 -0600, sudip shrestha <su...@gmail.com> wrote:
> > I have certain situations when I have to forward the web page upon
> > success to a certaion action or to a page with url such that it has a
> > query string with it: e.g.:
> > "/actions/myActionxx.do?wId=123" or "/pages/myPagexx.do?wId=123"
> >
> > Now, I can't provide the query strings with ids in struts-config.xml
> > file as the ids change depending upon the situation. So was wondering
> > if there was any other way around to it?
> >
> > ---------------------------------------------------------------------
> > 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
> 
>

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


Re: forward

Posted by Hubert Rabago <hr...@gmail.com>.
You can create a new ActionForward object, copy the data from the
original forward, and modify the path of the new object.
A quick way would be to add the ActionRedirect class to your code and use that:
http://svn.apache.org/viewcvs.cgi/struts/core/trunk/src/share/org/apache/struts/action/ActionRedirect.java?rev=153901&view=markup
Usage examples are given in the javadoc.

Hubert

On Mon, 14 Mar 2005 08:17:02 -0600, sudip shrestha <su...@gmail.com> wrote:
> I have certain situations when I have to forward the web page upon
> success to a certaion action or to a page with url such that it has a
> query string with it: e.g.:
> "/actions/myActionxx.do?wId=123" or "/pages/myPagexx.do?wId=123"
> 
> Now, I can't provide the query strings with ids in struts-config.xml
> file as the ids change depending upon the situation. So was wondering
> if there was any other way around to it?
> 
> ---------------------------------------------------------------------
> 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