Struts & Jersey Servlets with JSP & Webpack Front End

we currently have a struts 1.2 web application with casual JSP web pages. We want to migrate our application to Rest service web application with a webpack project front end.

As this will be a migration process where old pages will be served under oracle weblogic server and new ones will be served under a different production server.

We will still hold our backend server to serve restful apis.

The problem is when I call a api from webpack project it creates a new session and I can not use the session data of logged user.

I created a singleton hashmap to store session object where I can send key to new pages which enables to get session data but it seemed wrong and I wanted to ask if there is another way to implement this.

Edit: I tried to make it more visible with this picturehere



I ended up creating a Webpack application and publishing a dist folder on Apache which is mapped under the same domain of the parent application. This enabled to move between two different front ends without any problems.

Source: stackoverflow