You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jim Theodoridis <st...@tera.gr> on 2005/02/28 18:37:06 UTC

Action forwards to a URL outside application

Hello

I have an action that takes informations from a BD
How can I sent that information as parameters to a URL diferent than my 
application?
etc:

http://www.tera.gr?user=assaasd&password=21321




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


Re: Action forwards to a URL outside application

Posted by Christian Bollmeyer <ja...@christianbollmeyer.de>.
On Monday 28 February 2005 18:47, Shey Rab Pawo wrote:
> I don't know what a bd is but just make your action forward whatever
> you want to forward to.

Now, this may not be too helpful, regardless of whether 'BD'
means Business Delegate or is a typo for 'DB'. In fact, I
would prefer the first alternative, as that would indicate
Patterns usage and proper architecture. Anyhow: one
crucial thing that should come instantly to mind is that
- with Struts or without - forwards (Servlet API) are limited
to the same JVM, often, the same Application context, as
they are handled internally by the server. In any other
case, one has to use a redirect (issuing a HTTP code
that points the browser to the actual target). Then,
there's none of the three scopes available for passing
parameters, so you have to transmit them by ordinary
HTTP means, in this case, as GET parameters appended
to the URL; properly encoded (response.encodeRedirectURL(),
was it?). There is no real problem if you *just* redirect (static),
as there is a redirect attribute to <forward> in  struts-config.xml.
But this is a 'static' mapping. If you want to transfer dynamic 
parameters to your external application, AFAIK you have to
build the target URL (parameter string appended) yourself,
and I still wonder what may be the best approach in this
case. Options are: 1.) coding the redirect manually
2.) overriding the Struts mapping with the parameter-
enriched target URL at runtime or 3.) taking the basic
URL from the mapping, appending the parameter
thing and then proceed as in 2.) To be honest,
I'm not sure what is best practice in this case, and
in real life, I often just fall back to 1.). Things would
be a lot easier if there were kind of an addParameter()
method somewhere (preferably in the Servlet API,
not in Struts), but there just isn't.

HTH,
-- Chris.

> On Mon, 28 Feb 2005 19:37:06 +0200, Jim Theodoridis <st...@tera.gr> 
wrote:
> > Hello
> >
> > I have an action that takes informations from a BD
> > How can I sent that information as parameters to a URL diferent
> > than my application?
> > etc:
> >
> > http://www.tera.gr?user=assaasd&password=21321
> >
> > -------------------------------------------------------------------
> >-- 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: Action forwards to a URL outside application

Posted by Shey Rab Pawo <pa...@gmail.com>.
I don't know what a bd is but just make your action forward whatever
you want to forward to.


On Mon, 28 Feb 2005 19:37:06 +0200, Jim Theodoridis <st...@tera.gr> wrote:
> Hello
> 
> I have an action that takes informations from a BD
> How can I sent that information as parameters to a URL diferent than my
> application?
> etc:
> 
> http://www.tera.gr?user=assaasd&password=21321
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 


-- 
No one ever went blind looking at the bright side of life.

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