3

I'm using Vaadin 7.4 with Spring using the "spring4vaadin" - Project. I'm deploying the Application on a Tomcat 7.0.29 with Servlet API 3.0.

I deploy the Application under the Root-Context of Tomcat ("/") and I'm using the @WebServlet-Annotation to set the actual context of the App to "/esb/*":

@WebServlet( value = "/esb/*"  , asyncSupported = true )
public static class Servlet extends SpringVaadinServlet {

}

But every time when I navigate to the App-URL "http://localhost:8080/esb/" I get the error message: "Failed to load the bootstrap javascript ./../VAADIN/vaadinBootstrap.js?v=7.4.0" in a Browser-Pop-Up from Vaadin.

By web.xml looks like this:

<web-app id="ESAB_Cutting_Prototyping" version="3.0"
     xmlns="http://java.sun.com/xml/ns/javaee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
     http://java.sun.com/xml/ns/j2ee/web-app_3_0.xsd"
     metadata-complete="false">
</web-app>

If I set the context in the Tomcat Deployment-Configuration of my Intellij IDE it works without any problems.

I have no idea what to do - any help is greatly appreciated.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Frank Marx
  • 151
  • 11
  • I did some research using the Developer Tools of Chrome. And even that I've set the context of the servlet programmatically using the follow annotation: @WebServlet( value = "/esb/*" , asyncSupported = true ) to the context root "/esb", Vaadin is still trying to load the WidgetSet from the URL "http://localhost:8080/VAADIN/vaadinBootstrap.js?v=7.4.0" which is wrong. – Frank Marx Mar 31 '15 at 11:50

1 Answers1

3

Ok - I solved it.

My problem was, that I only did this:

@WebServlet( value = "/esb/*"  , asyncSupported = true )

but to make it work I had to do this:

@WebServlet( urlPatterns = { "/esb/*" , "/VAADIN/*" }  , asyncSupported = true )

So the servlet will listen to:

 http://localhost:8080/esb/

and to the subsequent request from the Vaadin-Framework:

 http://localhost:8080/VAADIN/...

which includes the Bootstrap-Code and the Widget's itself.

Frank Marx
  • 151
  • 11