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.
Must my web.xml contain wildcard redirector?
I created a Vaadin application in Eclipse using the project wizard. That is, via File -> New -> ... -> Vaadin project. It generated a web.xml with code like this:
<servlet-mapping>
<servlet-name>Foo Application</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
My application needs to use other servlets and static content. I don't want everything routed through com.vaadin.terminal.gwt.server.ApplicationServlet. But the wildcard URL pattern says everything will go to the "Foo Application" servlet.
Is there a way to configure web.xml more narrowly? I tried doing this:
<servlet>
<servlet-name>Foo Application</servlet-name>
<servlet-class>com.vaadin.terminal.gwt.server.ApplicationServlet</servlet-class>
<init-param>
<description>
Vaadin application class to start</description>
<param-name>application</param-name>
<param-value>com.example.foo.FooApplication</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>Foo Application</servlet-name>
<url-pattern>/Go</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Foo Application</servlet-name>
<url-pattern>/VAADIN</url-pattern>
</servlet-mapping>
My application will need to be invoked as http://localhost:8080/Foo/Go instead of just http://localhost:8080/Foo but that is fine.
I am not an expert with web.xml settings but have you tried to map to patterns like /Go/* and /VAADIN/* ?
OMG ... you are totally correct! D'oh!
Correct Solution:
<servlet-mapping>
<servlet-name>Foo Application</servlet-name>
<url-pattern>/Go/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Foo Application</servlet-name>
<url-pattern>/VAADIN/*</url-pattern>
</servlet-mapping>
Starting URL: http://localhost:8080/Foo/Go