Hi all,
I'm working on a website were the customer can enable a splash page that will
be displayed once per session to every visitor entering the site.
To achieve this, I've added a small session check with a to my BasePage, which
is the parent of all webpages:
if (!getSession().isSplashShown()) {
SplashData splash = em.find(SplashData.class, SplashData.ID);
if (splash.isEnabled()) {
throw new RestartResponseAtInterceptPageException(SplashWebPage.class);
} else {
getSession().setSplashShown();
}
}
This works like expected; the user is redirected to the URL the SplashWebPage
is mounted on.
On the SplashWebPage, which does not extends BasePage, I've added a
AjaxFallbackLink like this:
session.setSplashShown();
add(new AjaxFallbackLink<Void>("close") {
private static final long serialVersionUID = 1L;
public void onClick(AjaxRequestTarget target) {
if (!continueToOriginalDestination()) {
setResponsePage(HomePage.class);
}
}
});
Clicking this links does not work. The log tells me:
"ClassName=org.apache.wicket.protocol.http.WebResponse;MethodName=redirect;....|Redirecting
to "
(nothing after 'to', only a space)
and the AJAX response reads:
<ajax-response><redirect></redirect></ajax-response>
I was able to solve this issue by either:
- Changing the link to a non-ajax one
- Mounting the SplashWebPage on a path 'deeper' then the one the user
originally tried te open, such as "/splash/work/please". The user is then
redirected to "../../" correctly.
It this a bug in Wicket, or am I doing something stupid?
Thanks in advance,
Pepijn