Spring MVC & UI Components

前端 未结 4 1120
情深已故
情深已故 2021-01-31 03:18

I\'m in the \"technologies selection\" phase of a small, single-page web application that will be heavily-based in AJAX, and which will report to a Java backend.

In a pr

4条回答
  •  再見小時候
    2021-01-31 03:40

    Additionally apart from the things mentioned by Ludovico Fischer, if we consider the same question in now a days tech world than you can use one of the most power full thing of recent world : Angular. There are 2 sample scenario's.

    1. If your architecture is full client side: The integration is very natural for it. Spring MVC expose your service as a REST (JSON / XMl ... ) and your client application with Angular JS consume your JSON. Here the war application (Spring mvc ) must be deployed in a Servlet Container (Tomcat) and your client application can be deployed in the same server or in another server Nginx , Apache etc..
    2. If you want to keep page generation in the server side and only use AngularJS for some nice DOM manipulation so your code must be deployed in the same war (WEB-INF). Mixing the two approachs is not always a good idea. You can try thymeleaf to stay in server side page generation.

      Thus in this way you can have simultaneously the cool featuresof angular like templating, testability and clean view code.

提交回复
热议问题