problem in vaadin with servlet 3.0

i am using servlet 3.0 to configure servelt using @WebServlet instead of web.xml

Now problem is : i am using @WebServlet(urlPatterns = “/vaadin/*”)

so when i try to start my app with url “http://localhost:8080/test/vaadin

it gives me below error :

Note that you must also map /VAADIN/* to the servlet in addition to your application (/vaadin/* in your example). For more info, see

Joonas is (obviously) correct, so you need to add the other url pattern to your annotation. I
the correct form is like this:

@WebServlet(urlPatterns = {"/vaadin/*", "/VAADIN/*"} )

That way the your application is being served from “http://localhost:8080/test/vaadin” and the Vaadin content is being served from “http://localhost:8080/test/VAADIN,” which is the hard-coded path relative to your context root.

Note that it would be simpler to just do this:

@WebServlet(urlPatterns = "/*")

…and then access your web app at “http://localhost:8080/test” instead. Then when the client bits are trying to reach “http://localhost:8080/test/VAADIN” the request will go through your servlet and will work. (In production, of course, it’s better to have this be static content and map it separately anyway.)


it worked…