Hi,
I’m replacing an existing Spring MVC app with a Vaadin app. Therefore I need to support “old links” that are jumping into the app from outside. These links are like this: http://localhost:8080/app-name/page.htm?id=111&user=aaa
When I receive such a request, I have to create a new Vaadin window that shows the data that id 111 is related to (/app-name/new_page_111). When I enter the new url manually in the browser I get the desired Vaadin window, but when I try to redirect, I get a new browser window showing the new page but with the old url! In addition, when I click in the main application window on a component, the new window is opened again with the correct url.
I have a Servlet extending ApplicationServlet that handles all normal requests (see below). When I discover an old link I forward the rquest via a RequestDispatcher to the new url that the Vaadin window is using. It seems to me, that the request for the new window is somewhere in the queue and just needs an UI update to be activated…
Can somebody please tell me how to avoid the wrong url in the right window and how to suppress the second openeing of the window? The second problem is probably related to the wrong url and might go away when I have the right url from the beginning.
Code sample:
protected void service(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
String pathInfo = request.getPathInfo();
if (pathInfo != null && pathInfo.equals("/page.htm"))
{
String idStr = request.getParameter("id");
if (invIdStr != null)
{
Long id = Long.parseLong(idStr);
try
{
Application app = getExistingApplication(request, false);
if (app != null)
{
RequestDispatcher rd = request.getRequestDispatcher("/new_page_" + id);
if (rd != null)
{
rd.forward(request, response);
}
}
return;
}
catch (MalformedURLException ex)
{
}
catch (SessionExpiredException ex)
{
}
}
}
super.service(request, response);
}
Thanks
Andreas