danny11
danny11

Reputation: 483

Springboot, Vaadin and RestController

I created a new project with spring boot that includes vaadin and springmvc.

I added a restcontroller class and a vaadin view class annotated with @Route, yet when trying to access the view I receive a blank pages and a lot of failed http request with 405 access code to /VAADIN and /frontend paths.

When removing the restcontroller, the vaadin view worked.

Upvotes: 4

Views: 1036

Answers (1)

danny11
danny11

Reputation: 483

The solution was adding a servlet mapping to the vaadin resources:

@WebServlet(
    urlPatterns = {
            "/VAADIN/*", "/frontend/*"
    },
    initParams = {
            @WebInitParam(name = "productionMode", value = "false")
    })
public class MyServlet extends VaadinServlet {}

Don't forget to add @ServletComponentScan annotation.

Upvotes: 4

Related Questions