-5

We have an application which is running with Spring 4, jsp, jquery. The application is running on port 8080 into tomcat container.

Now we want to introduce Angular 4 for the new modules. Is it possible without changing the existing functionalities?

Amit Dhara
  • 420
  • 4
  • 11
  • 5
    The answer is yes. But I doubt that really helps you, does it? So start doing it, and ask a concrete question if you have an actual problem. – JB Nizet Jan 02 '18 at 17:17
  • can you refer to some starting point? Wondering how the both of the ports will work at the same time – Amit Dhara Jan 02 '18 at 17:23
  • No. And such a question would be off-topic. Again, Start doing it, solve one problem at a time, and ask a question if you have a concrete problem. You just need your Spring app to serve REST API requests for your angular app, and to serve the static files generated by the build of your angular app, in addition to what it already serves. – JB Nizet Jan 02 '18 at 17:25
  • you can use proxy.conf.json file to connect your rest Web API. Ex:- `https://stackoverflow.com/questions/37172928/angular-cli-server-how-to-proxy-api-requests-to-another-server` – Kasunjith Bimal Mar 09 '18 at 14:33

1 Answers1

0

Yes, It will run. Create a new project using angular CLI. Once you did that give command ng build --prod. I will Give output inside of dist folder. Copy all files which available in dist and paste in java web application inside of the webapps folder.

To run the angular application it simply required one of the servers from the below list. 1. Apache Tomcat 2. GlassFish 3. python 4. Node server

The port doesn't matter here. you can access both UI and Service by using sameport.

Anand Mohan
  • 79
  • 15