Embedding Vaadin 7 into Grizzly http server.

Hello, a long time ago (when vaadin was at version 6.3.3), I used to embedd vaddin app into grizzly.

This used to works very well. Now that I want to try the same thing but with an up to date version of vaadin (and grizzly), the old code must be reworked. The new code is something like that :

[code]
public class VGrizzly
{
public static void main(String args) throws IOException, InterruptedException
{
HttpServer httpServer = HttpServer.createSimpleServer(“WebContent”, 80);

    WebappContext ctx = new WebappContext("Vaadin", "/");
    final ServletRegistration reg = ctx.addServlet("Vaadin", com.vaadin.server.VaadinServlet.class);
    reg.addMapping("/", "/VAADIN/*");
    reg.setLoadOnStartup(1);

    ctx.setInitParameter("productionMode", "false");
    ctx.setInitParameter("UI", AddressbookUI.class.getName());

    ctx.deploy(httpServer);

    httpServer.start();

    while(true)
    {
        Thread.sleep(2000);
    }
}

}
[/code]I am using the Adress book sample to test this code, I can browse the application into my browser but there is 2 problems :

  • vaadin seems to detect cookies as disabled, and I don’t know why as it is not
  • the cookies disabled error message is no well displayed :

If I this modification :

reg.addMapping("/*");

I can browse the application with ANY url I want …/foo, …/bar (but not / ) and the error message is complete, but is still there.

I know that it seems to be a problem related to grizzly, but maybe you can help me.

Thanks for all, best regards.