Answer the question
In order to leave comments, you need to log in
Difference between template engines(velocity, freemaker) and jQuery?
Hello.
I have a question like this.
And what is better or worse than template engines (velocity, freemaker and others) than, for example, just jQuery?
Let's take the most common example.
In the case of the template engine.
@RequestMapping("/")
public String list(ModelMap model) {
model.put("feeds", feedService.getFeeds());
return "list";
}
@RequestMapping("/")
public String list(ModelMap model) {
return new ReturnObject();
}
Answer the question
In order to leave comments, you need to log in
neither worse nor better, it’s just that different approaches are possible and this is solved at the design level based on the task, someone uses template engines, someone doesn’t, and besides, what you came to (to separate the frontend and backend) has long been invented, for example in the MVC pattern.
jQuery is a JS library that makes it easy to work with the DOM, with AJAX. The template engine is something else, its purpose is to separate the presentation layer and the business layer in a web application. JSON, you can parse not only JQuery, but any JS library capable of it (if you need to do it on the client). It seems to me that you need to understand the concepts, otherwise you are confusing cold with sweet.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question