简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM