You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by st...@wryse.com on 2002/08/19 18:13:53 UTC

linking to a page on different domain

I have a fairly simple problem, but can't figure out how to resolve it 
within the Struts framework.

What I want to do is link to a page on a different server / domain.  
Normally, you just put like <a href="http://www.otherdomain.com/page?q1=v1> 
tag (or the struts link tag).  This circumvents the controller, of course.

Complicating things, I need to pass parameters that reside on the same 
Action Form.  This prevents me from pre-generating the link, because the 
user could toggle check boxes, type in text fields, etc., and these 
params+values should be passed to the request on www.otherdomain.com.

The only solution I've come up with is to have a Struts action that uses 
URLConnection to send back the requested page back as the response.  I 
haven't tried this yet (so maybe it doesn't work), but it seems like such a 
hack.  

Anyone have a better idea?  (I would *not* like to resolve this with 
javascript.)

Mike


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Security Filter

Posted by Elderclei R Reami <re...@vertisnet.com.br>.
Max,

Does SecurityFilter support tiles as well? I've already downloaded it from SourceFourge :) Could you please send 
me some configuration information? For instance, web.xml changes, how to use JDBCRealm with it, and so on. I 
would really appreciate it.

Regards,
Elder

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: linking to a page on different domain

Posted by Max Cooper <ma...@maxcooper.com>.
Mike,

The redirect will make the user's browser issue the request directly, which
may be important if they are logged in or simply have session data there.
Redirects are easy to code and will reduce the network load on your server.
Unless you have a really good reason to use a URLConnection, the redirect is
probably better. Similarly, unless you have a good reason to see what the
user submitted, it is probably even better to simply submit the form
directly to the other domain.

-Max

----- Original Message -----
From: <st...@wryse.com>
To: <st...@jakarta.apache.org>
Sent: Monday, August 19, 2002 12:06 PM
Subject: Re: linking to a page on different domain


> The second choice sounds better.  Is there a substantive difference
between
> using redirect vs. using URLConnection?  They seem very similar to me.
> Mike
>
> > Mike,
> >
> > If you don't know what the parameters are when you have the opportunity
> > to write the link URL, that means you need the user to submit the form.
> > You could have them submit the form directly to the other domain. If
> > you need to see their choices first, you could do your processing and
> > then construct a redirect to the other domain with the parameters on
> > the query string as the response.
> >
> > -Max
> >
> > ----- Original Message -----
> > From: <st...@wryse.com>
> > To: <st...@jakarta.apache.org>
> > Sent: Monday, August 19, 2002 9:13 AM
> > Subject: linking to a page on different domain
> >
> >
> >> I have a fairly simple problem, but can't figure out how to resolve it
> >> within the Struts framework.
> >>
> >> What I want to do is link to a page on a different server / domain.
> >> Normally, you just put like <a
> > href="http://www.otherdomain.com/page?q1=v1>
> >> tag (or the struts link tag).  This circumvents the controller, of
> >> course.
> >>
> >> Complicating things, I need to pass parameters that reside on the same
> >> Action Form.  This prevents me from pre-generating the link, because
> >> the user could toggle check boxes, type in text fields, etc., and
> >> these params+values should be passed to the request on
> >> www.otherdomain.com.
> >>
> >> The only solution I've come up with is to have a Struts action that
> >> uses URLConnection to send back the requested page back as the
> >> response.  I haven't tried this yet (so maybe it doesn't work), but it
> >> seems like such
> > a
> >> hack.
> >>
> >> Anyone have a better idea?  (I would *not* like to resolve this with
> >> javascript.)
> >>
> >> Mike
> >>
> >>
> >> --
> >> To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> >> For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >>
> >>
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org> For additional
> > commands, e-mail: <ma...@jakarta.apache.org>
>
>
> --
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: linking to a page on different domain

Posted by st...@wryse.com.
The second choice sounds better.  Is there a substantive difference between
using redirect vs. using URLConnection?  They seem very similar to me.
Mike

> Mike,
> 
> If you don't know what the parameters are when you have the opportunity
> to write the link URL, that means you need the user to submit the form.
> You could have them submit the form directly to the other domain. If
> you need to see their choices first, you could do your processing and
> then construct a redirect to the other domain with the parameters on
> the query string as the response.
> 
> -Max
> 
> ----- Original Message -----
> From: <st...@wryse.com>
> To: <st...@jakarta.apache.org>
> Sent: Monday, August 19, 2002 9:13 AM
> Subject: linking to a page on different domain
> 
> 
>> I have a fairly simple problem, but can't figure out how to resolve it
>> within the Struts framework.
>>
>> What I want to do is link to a page on a different server / domain.
>> Normally, you just put like <a
> href="http://www.otherdomain.com/page?q1=v1>
>> tag (or the struts link tag).  This circumvents the controller, of
>> course.
>>
>> Complicating things, I need to pass parameters that reside on the same
>> Action Form.  This prevents me from pre-generating the link, because
>> the user could toggle check boxes, type in text fields, etc., and
>> these params+values should be passed to the request on
>> www.otherdomain.com.
>>
>> The only solution I've come up with is to have a Struts action that
>> uses URLConnection to send back the requested page back as the
>> response.  I haven't tried this yet (so maybe it doesn't work), but it
>> seems like such
> a
>> hack.
>>
>> Anyone have a better idea?  (I would *not* like to resolve this with
>> javascript.)
>>
>> Mike
>>
>>
>> --
>> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
>> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>>
>>
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org> For additional
> commands, e-mail: <ma...@jakarta.apache.org>


-- 



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: linking to a page on different domain

Posted by Max Cooper <ma...@maxcooper.com>.
Mike,

If you don't know what the parameters are when you have the opportunity to
write the link URL, that means you need the user to submit the form. You
could have them submit the form directly to the other domain. If you need to
see their choices first, you could do your processing and then construct a
redirect to the other domain with the parameters on the query string as the
response.

-Max

----- Original Message -----
From: <st...@wryse.com>
To: <st...@jakarta.apache.org>
Sent: Monday, August 19, 2002 9:13 AM
Subject: linking to a page on different domain


> I have a fairly simple problem, but can't figure out how to resolve it
> within the Struts framework.
>
> What I want to do is link to a page on a different server / domain.
> Normally, you just put like <a
href="http://www.otherdomain.com/page?q1=v1>
> tag (or the struts link tag).  This circumvents the controller, of course.
>
> Complicating things, I need to pass parameters that reside on the same
> Action Form.  This prevents me from pre-generating the link, because the
> user could toggle check boxes, type in text fields, etc., and these
> params+values should be passed to the request on www.otherdomain.com.
>
> The only solution I've come up with is to have a Struts action that uses
> URLConnection to send back the requested page back as the response.  I
> haven't tried this yet (so maybe it doesn't work), but it seems like such
a
> hack.
>
> Anyone have a better idea?  (I would *not* like to resolve this with
> javascript.)
>
> Mike
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>