Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Vaadin Servlet and Session is not loaded correct in 7.5.2
I use a UI(WX) to redirect the application to UI_TK(${URI}/TK?agent=${agent.id}) and UI_Reg(${URI}/Reg?code=${code}) based on some incoming parameters.
class WX extends UI {
@Override
protected void init(VaadinRequest request) {
......
if(currentUser.isAuthenticated()){
......
getPage().setLocation("${URI}/TK?agent=${agent.id}")
}else{
......
getPage().setLocation("${URI}/Reg?code=${code}")
}
......
}
}
The servlet code is here:
class IncanaServlet extends TouchKitServlet {
Log log = LogFactory.getLog(this.class)
@Override
protected void servletInitialized() throws ServletException {
super.servletInitialized()
getService().addSessionInitListener(new SessionInitListener() {
@Override
public void sessionInit(SessionInitEvent event) {
event.getSession().addBootstrapListener(new BootstrapListener(){
@Override
public void modifyBootstrapPage(BootstrapPageResponse response) {
......//Generate some element to add to body
VaadinRequest vr = getService().getCurrentRequest()
String URL = vr.getRequestURL().toString()
//URI will be TK for register and Product for buying
String URI = vr.getRequestURI()
String query = vr.getQueryString()
........//Generate some element to add to body
body.append(......)//Add the html element
}
@Override
public void modifyBootstrapFragment(BootstrapFragmentResponse response) {
}
})
}
})
}
When in Vaadin 7.4.7
The log shows the sessionInit is called after getPage().setLocation("${URI}/TK?agent=${agent.id}") and before the UI_TK is loaded.
- load UI_WX
- load SessionInitListener(vr.getQueryString() is right)
- load UI_TK
When in Vaadin 7.5.2
The log shows the sessionInit will be called 2 or 3 seconds later after getPage().setLocation("${URI}/TK?agent=${agent.id}") and after the UI_TK is loaded.
- load UI_WX
- load UI_TK
- (2 or 3 seconds later)load SessionInitListener(vr.getQueryString() is empty)
Which means the SessionInitListener can not get the real QueryString(): String query = vr.getQueryString()
I try several times and I think the only reason is the version of Vaadin!