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.
Guice and custom widget set
I've integrated Guice into my Vaadin app. Everything works until I incorporate my custom widget set. Here's a snippet from my GuiceServletInjector class:
ServletModule module = new ServletModule() {
@Override
protected void configureServlets() {
Map<String, String> params = new HashMap<String, String>();
params.put("widgetset", "com.corralweb.VaadintestWidgetset");
serve("/demo").with(GuiceApplicationServlet.class);
serve("/VAADIN/*").with(GuiceApplicationServlet.class);
bind(Application.class).to(VaadintestApplication.class).in(ServletScopes.SESSION);
}
};
The first serve("/demo") is my main application. I believe the serve("/VAADIN/*") needs to be there somehow so that the widgetset is found - but it's not working.
I tried adding the Map params there to both serve's but it still doesn't work - I get a frozen blank page.
What's the correct way to set up Guice and custom widgets?
Ok, my frozen blank page was happening because once I'd configured to it work with the widgeset the paths for serving static files weren't working. I rely on some Javascript libraries.
I had to change the '"/demo" in the serve guice call to "/demo/". The paths for my Javascript files using the writeAjaxPageHtmlVaadinScripts() call were specified like "./jquery/jquery-1.7.2.min.js". I had to specify them from the project root directory as "/VaadinTest/jquery/jquery-1.7.2.min.js" instead.
So, now my widgetset works due to the "/VAADIN/*", my app works due to the "/demo/" and the correct static (Javascript) files are served because they don't match either serve() specification and default to the default servlet.