You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Nili Adoram <ni...@qlusters.com> on 2007/10/09 14:46:05 UTC

how to forward request to an external URL

Hi all,

Suppose I want to forward the HTTP request to some external url (NOT a
wicket page, e.g. a JSP page).
I want to end the request cycle at this point ( not include this URL inside my page).
How can I simulate request.getRequestDispatcher(url).forward() within a
wicket page?
Thanks
Nili




-- 
10x,
Nili Adoram


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: how to forward request to an external URL

Posted by Matthijs Wensveen <m....@func.nl>.
For completeness sake: 
http://cwiki.apache.org/WICKET/how-to-redirect-to-an-external-non-wicket-page.html

Igor Vaynberg wrote:
> requestcycle.setrequesttarget(new redirectrequesttarget(url));
>
> -igor
>
>
> On 10/9/07, Nili Adoram <ni...@qlusters.com> wrote:
>   
>> Hi all,
>>
>> Suppose I want to forward the HTTP request to some external url (NOT a
>> wicket page, e.g. a JSP page).
>> I want to end the request cycle at this point ( not include this URL inside my page).
>> How can I simulate request.getRequestDispatcher(url).forward() within a
>> wicket page?
>> Thanks
>> Nili
>>
>>
>>
>>
>> --
>> 10x,
>> Nili Adoram
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>   


-- 
Matthijs Wensveen
Func. Internet Integration
W http://www.func.nl
T +31 20 4230000
F +31 20 4223500 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: how to forward request to an external URL

Posted by Igor Vaynberg <ig...@gmail.com>.
requestcycle.setrequesttarget(new redirectrequesttarget(url));

-igor


On 10/9/07, Nili Adoram <ni...@qlusters.com> wrote:
>
> Hi all,
>
> Suppose I want to forward the HTTP request to some external url (NOT a
> wicket page, e.g. a JSP page).
> I want to end the request cycle at this point ( not include this URL inside my page).
> How can I simulate request.getRequestDispatcher(url).forward() within a
> wicket page?
> Thanks
> Nili
>
>
>
>
> --
> 10x,
> Nili Adoram
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: how to forward request to an external URL

Posted by Igor Vaynberg <ig...@gmail.com>.
On 10/10/07, Al Maw <wi...@almaw.com> wrote:
> Nili Adoram wrote:
> > Suppose I want to forward the HTTP request to some external url (NOT a
> > wicket page, e.g. a JSP page).
> > I want to end the request cycle at this point ( not include this URL inside my page).
> > How can I simulate request.getRequestDispatcher(url).forward() within a
> > wicket page?
>
> You use getRequestDispatcher(url).forward(). ;-)
>
> ((WebRequest)getRequest()).getHttpServletRequest().getRequestDispatcher(url).forward()
> to be precise.
>
> For details of how to embed JSP fragments within a page, see here:
> http://herebebeasties.com/2007-03-01/jsp-and-wicket-sitting-in-a-tree/
>
> ...which is basically the same problem (only I'm include()ing, not
> forward()ing). You might need to tell Wicket to use one-pass rendering
> to make this work properly, and you may need to fiddle with
> setRedirect(false).

or you can just do what i said and that should always work :)

-igor

>
> Good luck,
>
> Regards,
>
> Al
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: how to forward request to an external URL

Posted by Al Maw <wi...@almaw.com>.
Nili Adoram wrote:
> Suppose I want to forward the HTTP request to some external url (NOT a
> wicket page, e.g. a JSP page).
> I want to end the request cycle at this point ( not include this URL inside my page).
> How can I simulate request.getRequestDispatcher(url).forward() within a
> wicket page?

You use getRequestDispatcher(url).forward(). ;-)

((WebRequest)getRequest()).getHttpServletRequest().getRequestDispatcher(url).forward() 
to be precise.

For details of how to embed JSP fragments within a page, see here:
http://herebebeasties.com/2007-03-01/jsp-and-wicket-sitting-in-a-tree/

...which is basically the same problem (only I'm include()ing, not 
forward()ing). You might need to tell Wicket to use one-pass rendering 
to make this work properly, and you may need to fiddle with 
setRedirect(false).

Good luck,

Regards,

Al



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org