Spring MVC as REST Provider with AngularJS vs. JSP / Velocity / Freemarker for the Web Tier

The Spring MVC creators recommend by default to use JSP or one of the templating engines (Freemarker, Velocity) to provide the web tier.

On the other hand, proponents of JavaScript frameworks would probably recommend using Spring MVC only as a REST / WS service provider and completely decouple the service layer from the web tier that would be created in one of the JS frameworks (like Angular JS).

Does the latter solution have any disadvantages compared to the previous one? Is one approach now considered the current industry standard?


source to share

2 answers

Yes, the later one, which has a drawback compared to the previous one, only that with the help of the latter you control your application to some level of complexity, which I think you do not need in the first place.

Complex examples are like you create some kind of template and end up creating an application that is not SEO friendly, so in order to remove it, you will include some other technology in your stack. Second, you get a real opportunity to make your application look awesome using the SPA architecture, but for a reason. But here, on the contrary, the former will probably make your job easier, but with much more network bandwidth. So for me your choice is what suits you, either you want to make it easy and pay more for the hosting provider, or do the hard work, maximize efficiency and minimize your costs.

But yes, when you follow the latest industry standard, then its obvious to go with the second.



Ok, it depends on your requirements. With Javascript frameworks like AngularJS you get MVC on the client side, you need to write javascript controllers, whereas with Spring MVC you get MVC architecture on the server side.

AngularJS is mainly used for developing single page applications that involve heavy DOM manipulation. This way the VC MVC part will be written to javascript and only loaded once.

In my opinion, there is no revolutionary difference between them. You must continue with whatever is comfortable for you.



All Articles