You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "mike.hua" <hz...@sohu.com> on 2013/03/04 04:01:11 UTC
How to redirect an external web site and where is setRequestTarget
method?
According to the web site:
https://cwiki.apache.org/WICKET/how-to-redirect-to-an-external-non-wicket-page.html
public void onSubmit()
{
// Make sure no output for the current cycle is ever sent.
getRequestCycle().setRequestTarget(new
RedirectRequestTarget("http://www.163.com"));
}
I can't find the method setRequestTarget under getRequestCycle().
What's the matter?
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-redirect-an-external-web-site-and-where-is-setRequestTarget-method-tp4656924.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: How to redirect an external web site and where is
setRequestTarget method?
Posted by Stephen Walsh <st...@connectwithawalsh.com>.
I'm using throw new RestartResponseAtInterceptPageException to redirect to
an external page. That doc is for Wicket 1.3. I found that same page and
started using RestartResponseAtInterceptPageException instead. I forget
where I found the documentation on it, but I believe that was a change with
1.5+.
_______________________________________
Stephen Walsh | http://connectwithawalsh.com
On Sun, Mar 3, 2013 at 9:01 PM, mike.hua <hz...@sohu.com> wrote:
> According to the web site:
>
> https://cwiki.apache.org/WICKET/how-to-redirect-to-an-external-non-wicket-page.html
>
> public void onSubmit()
> {
> // Make sure no output for the current cycle is ever sent.
> getRequestCycle().setRequestTarget(new
> RedirectRequestTarget("http://www.163.com"));
> }
>
> I can't find the method setRequestTarget under getRequestCycle().
>
> What's the matter?
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/How-to-redirect-an-external-web-site-and-where-is-setRequestTarget-method-tp4656924.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: How to redirect an external web site and where is
setRequestTarget method?
Posted by "mike.hua" <hz...@sohu.com>.
It is good to throw the RedirectToUrlException!
@Override
public void onSubmit() {
RedirectToUrlException objRedirect;
objRedirect = new RedirectToUrlException("http://www.163.com/");
throw objRedirect;
}
Thanks for Vineetsemwal and Stephen's help!
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-redirect-an-external-web-site-and-where-is-the-setRequestTarget-method-tp4656924p4656963.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: How to redirect an external web site and where is
setRequestTarget method?
Posted by vineet semwal <vi...@gmail.com>.
use RedirectToUrlException
On Mon, Mar 4, 2013 at 8:31 AM, mike.hua <hz...@sohu.com> wrote:
> According to the web site:
>
> https://cwiki.apache.org/WICKET/how-to-redirect-to-an-external-non-wicket-page.html
>
> public void onSubmit()
> {
> // Make sure no output for the current cycle is ever sent.
> getRequestCycle().setRequestTarget(new
> RedirectRequestTarget("http://www.163.com"));
> }
>
> I can't find the method setRequestTarget under getRequestCycle().
>
> What's the matter?
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/How-to-redirect-an-external-web-site-and-where-is-setRequestTarget-method-tp4656924.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
regards,
Vineet Semwal