I know this situation i am going to explain is trivial these days. The issue the application is facing is for cross origin access.
I have an old JSP application which has web editor component that I want to access in my new UI React application. I am actually running both the applications on the same tomcat9 container. But the old application is running on localhost:8080 and the new one on localhost:3000. Obviously got a cross origin issue, to overcome this i have tried the following :
Tried the resources Setting cookie to an iframe src, How to overcome the CORS issue in ReactJS, How to allow CORS in react.js? and Access Control Origin Header error using Axios
Tried to build the React application with port 8080 and placed it as part of JSP application so that we are able to access both the applications with different contexts.
Configured web.xml as :
<welcome-file-list> <welcome-file>index.html</welcome-file> // React application entry point <welcome-file>index.jsp</welcome-file> // JSP application entry point </welcome-file-list>