Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 414 Vote(s) - 3.44 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Difference between spring JSP MVC and Thymeleaf MVC

#1
What is the difference between spring JSP MVC and Thymeleaf MVC? Which one is best way for spring web design ?
Reply

#2
Thymeleaf is template resolver that process template and produce pure html.

Thymeleaf is way better in my opinion because it have good underlying priciples and exploits natural behaviour of browsers.

Jsp makes html hard to read, it becomes weird mixture of html and java code which makes a lot of problems in comunication between designer - developer.

Thymeleaf preserves html and only adds tags that are intuitive and very expressive. It enables you to work in offline mode and it works great with spring and I definitely recommend it above jsp.

[To see links please register here]

Reply

#3
Both of them are view layers of Spring MVC. Firstly, the very basic difference is the file extensions. (`.jsp` & `.html`)

Branislav in the comments is right, `JSP` is not a template engine. It's compiled to the servlet and then the servlet is serving web content. On the other hand, Thymeleaf is a template engine which takes the `HTML` file, parses it and then produces web content which is being served.

- Thymeleaf is more like an HTML-ish view when you compare it with `JSP` views.

- We can use prototype code in thymeleaf :

[To see links please register here]


- Since it is more HTML-ish code, thymeleaf codes are more readable (of course you can disrupt it and create unreadable codes, but at the end, it will be more readable when you compare it with `.jsp` files)

- Standard Dialect (**The expression language**) is much more powerful than JSP Expression Language

- If we put all this to an edge, thymeleaf is the slow one here.

I would suggest you to take a look at this doc :

[To see links please register here]



Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through