2

I'm using Spring and Vaadin in combination in one Web application. I mapped the DispatcherServlet to the URL "/" (using it for a REST API) and mapped the Vaadin Servlet on /rsp. When I open the Application I get the following error message in the Browser: "Failed to load the bootstrap javascript: ./VAADIN/vaadinBootstrap.js" and the following log entries in my server:

12:21:15.915 [http-bio-8088-exec-4] WARN  org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/rsp/VAADIN/vaadinPush.debug.js] in DispatcherServlet with name 'dispatcher'
12:21:15.922 [http-bio-8088-exec-5] WARN  org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/rsp/VAADIN/vaadinBootstrap.js] in DispatcherServlet with name 'dispatcher'
12:21:15.934 [http-bio-8088-exec-6] WARN  org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/rsp/VAADIN/themes/parsp-theme/favicon.ico] in DispatcherServlet with name 'dispatcher'
12:21:15.974 [http-bio-8088-exec-8] WARN  org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/rsp/VAADIN/themes/parsp-theme/favicon.ico] in DispatcherServlet with name 'dispatcher'
12:21:16.013 [http-bio-8088-exec-8] WARN  org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/rsp/VAADIN/themes/parsp-theme/favicon.ico] in DispatcherServlet with name 'dispatcher'
12:21:16.052 [http-bio-8088-exec-8] WARN  org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/rsp/VAADIN/themes/parsp-theme/favicon.ico] in DispatcherServlet with name 'dispatcher'

I could map the dispatcherservlet to /rest which would solve the problem, but is it possible to map both servlets to the same path ("/") so each serves what it could serve (/VAADIN/... by the vaadin servlet while the rest API is served by the dispatcher servlet)

Jens Baitinger
  • 2,230
  • 14
  • 34

1 Answers1

0

You need to have VaadinServlet mapped to /VAADIN/* as well. The front-side is fixed to use this path for fetching Vaadin-reated resources. You can read more about it in the docs: https://vaadin.com/docs/v8/framework/application/application-environment.html#application.environment.servlet-mapping.

Which version of Vaadin and Spring do you use? Vaadin Spring Servlet is designed to work with Spring MVC pretty much out-of-the-box