Hello,
to avoid the under
https://vaadin.com/forum#!/thread/4440607
described problem, I want to write a servlet that geocodes an adress and calls the vaadin app to show the adress on a map.
To do so, I have to forward from the preceding servlet to the vaadin app in order to keep the original URL.
To test this process I have written a servlet with the following code in the doGet-function:
final String forwardUrl = "/api/";
final RequestDispatcher dispatcher = request.getRequestDispatcher(forwardUrl);
dispatcher.forward(request, response);
and have modified the app’s web.xml to:
<servlet-mapping>
<servlet-name>Vaadin Application Servlet</servlet-name>
<url-pattern>/api/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Vaadin Application Servlet</servlet-name>
<url-pattern>/VAADIN/*</url-pattern>
</servlet-mapping>
<servlet>
<description></description>
<display-name>GeocodingServlet</display-name>
<servlet-name>GeocodingServlet</servlet-name>
<servlet-class>de.rossmann.wettbewerberumfeld.servlet.GeocodingServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>GeocodingServlet</servlet-name>
<url-pattern>/GeocodingServlet/*</url-pattern>
</servlet-mapping>
The servlet is listining to the url-pattern /GeocodingSevlet/* where the vaadin app runs under /api/. I also integrated the /VAADIN/-pattern.
When forwarding to /api I see the spinner and in the js console an “Uncaught SyntaxError: Unexpected end of input” appears.
When forwarding to /api/ I get “failed to load vaadinBootstrap.js”, although when manualy requested per url in the browser the js-file is found.
Any ideas what I’m doing wrong? Help is very much appreciated!
Thanks in advance
Armin