ZedroS Schwart wrote:
> add(new AbstractAjaxTimerBehavior(Duration.seconds(5)) {
> protected void onTimer(AjaxRequestTarget target) {
> setRedirect(true);
> getResponse().redirect("http://www.google.com");
> }
> });
>
> What's wrong with my code ??
You're trying to do a redirect in an AJAX response. I don't think that
works.
You could probably make the above work with
target.appendJavascript("window.location='http://www.google.com'");
instead of a getResponse().redirect(...).
FWIW, I do this like so:
In your LogoutPage.html:
<wicket:head>
<meta http-equiv="refresh" content="0" wicket:id="metaRefresh" />
</wicket:head>
In your LogoutPage.java:
WebMarkupContainer refresh = new WebMarkupContainer("metaRefresh");
String homePageUrl = "0;" + urlFor(getApplication().getHomePage(),
null).toString();
refresh.add(new SimpleAttributeModifier("content", homePageUrl));
add(refresh);
HTH.
Regards,
Al
Al
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user