ParameterHandler not called when vaadin app is embedded


I’m seeing the following behavior

  1. http://localhost:8080/artools/?ID=100

==> artools location has an index.html that uses ‘div’ technique to embed a vaadin component. Effectively the handleParameters() method isn’t called.

  1. http://localhost:8080/artools/TableImport/?ID=100

==> calls upon th application specifically - no embedding whatsoever. Now the handleParameters() method is called.

Question: why is handleParameters() not called when embedding vaadin component?

The parameter handler is only called for normal HTTP-requests, not UIDL requests. If you have a custom page that embeds the application the HTTP-request from the browser will go to your index.html and the parameters will be passed along to index.html, not the servlet and thus it will never receive the parameters. The application will then start and do UIDL-requests to the servlet, without the parameters.

The index.html is served from the servlet container.

What I’ve done now is to include a servlet filter that picks up the request parameter and sticks it in the HttpSession - which is created anyway by the Vaadin application. Using the TransactionListener interface, I’m able to ‘pick up’ the request parameter and work with it. So this is no longer using the ParameterHandler and works for me in this case.

Can you think of any reason why this would be bad?

Hi, would you please mind explaining how you get a reference to the HttpSession which is created by Vaadin before the embedded vaadin application even loads?

Do you store the HttpSession in some global scope and then pass it creating your vaadin application instance is invoked?

And second, how are you embedding? is it with a div or iframe?