Oracle_DBA
Oracle_DBA

Reputation: 13

Vaadin and Java EE using Servlets and JSP Integration

I have to develop 2 applications. On of those is an application which is already running on Tomcat using Servlets and JSP. The other is an application which is completely on Vaadin running on VMware vfabric localhost.

Now I want to integrate both as a single web application. How can I do this?

Upvotes: 0

Views: 1491

Answers (2)

Alejandro Duarte
Alejandro Duarte

Reputation: 1479

You need to move the code of one of your applications into the other one. I would suggest you move Vaadin code into your JSP application as the later is usually more complex in terms of Servlets and Filters.

Once you have moved all the code, you need to make sure your VaadinServlet works alongside the existing Servlets and Filters in your JSP application. This means making sure that the JSP application's Servlets and Filters won't interfere with requests that should be handled by the VaadinServlet.

At that point you should be able to have both JSP and Vaadin running as a single Java web application. You have to pay attention to any shared resource that the applications might be using (for example the HTTP session) and fix/modify accordingly (this highly depends on your implementation details).

If you want to include Vaadin UIs into JSP pages, you can follow the steps of this example: https://github.com/alejandro-du/vaadin-jsp-integration-example. When including Vaadin Uis into JSP pages, test for Vaadin View implementations in your code (by adding/changing the URI fragment in the browser).

If your applications have any kind of Rol Based Access Control mechanisms, you will need to test and fix accordingly (something that also highly depends on your implementation details).

Upvotes: 0

d2k2
d2k2

Reputation: 714

Check out the Chapter 11.2 in the Book of Vaadin:

There is a detailed description how to implement vaadin UIs inside html pages.

The simplest solution would be to use an iframe inside your JSP page , where you embedd a vaadin UI

Upvotes: 1

Related Questions