They have even provided a comparison b/t JSP and thymeleaf here.
Even on the Spring forum, its is recommended to use thymeleaf. here
Could someone advise me what would be best for me to develop website. Where I can get proper support for the technology I am using, should be fast to learn and fast to develop, should be fast in execution.
Any advice would be heartily appreciated.
For me, the ease of development and maintainability rank much higher than rendering speed of the page, which you might not even notice anyway. Why don't you just try it out? Write a page in Thymeleaf, write a page in JSP, time how much time you spent on understanding either language and how much time you spent on writing the page, and time how much time it takes to load the page.
I would only recommend using JSP if you've determined Thymeleaf is too slow for your purposes.
Aside from processing speed, I want to mention one advantage JSP has IMO: the availability of tag libraries. While those seem to be in slow decline in favor of jQuery plugins and the like, there are still a lot of very useful tag libraries out there. That's something to consider especially for complex pages. I wouldn't rank FreeMarker or Velocity higher than JSP, just for that reason.
And came to know that if I want my application to be ready very fast and easy to maintain, then Thymeleaf would be good choice. But if the number of requests,Requests per second,Time per request etc. are major concerns, then Freemaker would be the best choice.
Velocity is not a good choice any way since it has very bad support.
So, what I am doing as of now is, I will start with thymeleaf and design my first web application which is not concerned about user traffic. Then I will have a better understanding of template engine, so it will not take much effort to learn Freemaker for large traffic websites.
Tim Moores wrote:That page specifically says that the speed difference between Velocity, FreeMarker and JSP is rather small. That implies that other considerations will/should likely be the deciding factor between them.
Yes, that why I choose Thymeleaf as the first technology to learn as it is easy to learn and for my first project, speed is not the major factor. And once I get to know how to make web apps using spring boot and Thymeleaf, it will be easy to switch template engine depending on the requirement.
Puspender Tanwar wrote:But if the number of requests,Requests per second,Time per request etc. are major concerns, then Freemaker would be the best choice.
You cannot draw that conclusion. It depends on the type of the requests, the complexity of the templates, etc.
The only way you will know which is right for your application in terms of speed, is to benchmark them for your application yourself, and only after you're not happy with the speed of the easiest one to develop with.
Stephan van Hulst wrote:The only way you will know which is right for your application in terms of speed, is to benchmark them for your application yourself, and only after you're not happy with the speed of the easiest one to develop with.
But it will be difficult to develop the application once again from scratch if I made wrong technology choice. I am confused now. Can you please advice me a path. My website will not have that much of traffic as of now, but yes I have to code it very fast in 50days. Wouldn't Freemaker be the best choice, as it has good speed, less complex then JSP, good support ?
You can write a proof of concept with different languages before you write your entire application. If the difference in speed between the two versions of the proof of concept is too large, go for the faster language. If you don't notice a big difference, go with the easier language.
Your proof of concept can just be one page that you expect is going to take the most traffic. Then, perform load and stress tests.
Puspender Tanwar wrote:Wouldn't Freemaker be the best choice, as it has good speed, less complex then JSP
I'd argue that JSP is only as complex as you make it. Sure, you could put a bunch of crap in views that doesn't belong there and cause the JSPs to be nightmarish; or you could do it right, and keep the JSPs as simple as possible, doing all the heavy lifting in the controllers where it belongs.
In my opinion, the "problems" with JSP are that people have been using it badly for over 20 years and so there are lots of examples out there that are just plain awful. Even books on JSP get it wrong.
But if you already know JSP, and have the discipline to keep the views simple, I'd suggest that you probably don't need to spend time learning yet another technology.
Just my 2¢
Bear Bibeault wrote:Sure, you could put a bunch of crap in views that doesn't belong there and cause the JSPs to be nightmarish; or you could do it right, and keep the JSPs as simple as possible, doing all the heavy lifting in the controllers where it belongs.
Hi Bear, could you please explain it with an example. Or any resource you might have, please share.
Basically, your JSP should look mostly like a simple HTML page with some JSTL and EL markup to show the dynamic data.