PushStateNavigation + CDI

Hello,

In my application I need two differents UI: one for customers and another one for operators.
I wanted to use two different servlets because I will need different configurations.

I’m using Vaadin 8.2.1 (also tried with 8.3.0) and Vaadin CDI 3.0.0.
The context-root of the application is
/app
.

And this is what I’m doing:

Servlet 1 mapped with /operator:

@WebServlet(urlPatterns = { "/operator/*" }, name = "OperatorServlet", asyncSupported = true)
@VaadinServletConfiguration(ui = OperatorUI.class, productionMode = false)
public class OperatorServlet extends VaadinCDIServlet {

// ... some code

}

Servlet 2 mapped with /VAADIN and /customer:

@WebServlet(urlPatterns = { "/VAADIN/*", "/customer/*" }, name = "CustomerServlet", asyncSupported = true)
@VaadinServletConfiguration(ui = CustomerUI.class, productionMode = false)
public class CustomerServlet extends VaadinCDIServlet {

// ... some code

}

And this is one the UI for the customers, using push state:

@CDIUI("[b]
customer
[/b]")
@PushStateNavigation
public class CustomerUI extends UI {

@Inject
private CDINavigator navigator;

// ... some code including navigator.init

}

And this is an example of view:

@CDIView(value = "[b]
settings
[/b]", uis = CustomerUI.class)
public class SettingsView implements View {

// ... some code

}

The problem is: if I navigate to http://localhost:8080/app/customer/settings the url changes to http://localhost:8080/settings

If I change CustomerServlet urlPatterns to “/*” then it works and stays in http://localhost:8080/app/customer/settings.

What am I doing wrong? Am I missing somthing about push state navigation?

Thank you in advance

It should be noted that with current implementation of push state navigation is done so that you cannot have another servlet configured within same context path, they will mix up. So you need to have two UI’s in different context roots.

All right…good to know.
For now I’ll use just one servlet.

Thank you!