Servlet mapping does not work

I have create a new maven project with vaadin-archetype-application version 7.1.9

I have run the commands mvn vaadin:compile jetty:run
Everithing works accessing http://localhost:8080/teste/

I want to acess using the url http://localhost:8080/teste/app

I have change


From

@Theme(“mytheme”)
@SuppressWarnings(“serial”)
public class MyVaadinUI extends UI
{
@WebServlet(value = “/*” ,asyncSupported = true)
@VaadinServletConfiguration(productionMode = false, ui = MyVaadinUI.class, widgetset = “foo.AppWidgetSet”)
public static class Servlet extends VaadinServlet {
}


To

@WebServlet(value = “/app/*” ,asyncSupported = true)
@VaadinServletConfiguration(productionMode = false, ui = MyVaadinUI.class, widgetset = “foo.AppWidgetSet”)
public static class Servlet extends VaadinServlet {
}

trying to access the URL
http://localhost:8080/teste/app
shows the error

HTTP ERROR 404

Problem accessing /teste/app. Reason:Not FoundPowered by Jetty://

I already try
@WebServlet( value ={“/app/", "/VAADIN/”} ,asyncSupported = true)
@WebServlet( urlPatterns = {“/app/", "/VAADIN/”}, ,asyncSupported = true)

nonthing worked

What am I do wrong?

I have try folowing these posts
https://vaadin.com/forum#!/thread/390813
https://vaadin.com/old-forum/-/message_boards/view_message/4038379
https://vaadin.com/forum#!/thread/1965338
https://vaadin.com/forum#!/thread/136600
https://vaadin.com/forum#!/thread/2043315

and others in stackoverflow website

any ideia?

Note that the pattern /app/* does not match your URL http://localhost:8080/teste/app
So you should add a pattern that does…


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

Hi Petrus, didn’t work


This work

@WebServlet(urlPatterns = {/*} → http://localhost:8080/teste/app , http://localhost:8080/teste/


This does not work

@WebServlet(urlPatterns = {“/VAADIN/", "/vaadin/”, “/app”, “/app/*” } → http://localhost:8080/teste/app , http://localhost:8080/teste/

@WebServlet(urlPatterns = {“/VAADIN/", "/app/” } → http://localhost:8080/teste/app , http://localhost:8080/teste/

{“/VAADIN/", "/vaadin/”, “/app”, “/app/*” }

HTTP ERROR 404

Using command mvn jetty:run
Vaadin 7.1.9

It looks like fun, everything thing I try to do, always happen something strange preventing to do it, almost times I waste much time trying make some “basic” feature works fine

So, why didn’t work?

I’d like that root of the website will use JSF, and the vaadin vaadin application will be in the /app for example, I dont know what’s wrong!

Please, any help?

Make sure you dont have anything in the web.xml related to your servlet, not sure if the web.xml will take precedence.
If that still dont work, Try Tomcat or Glassfish instead of Jetty…