What is better between JSP and velocity in - Performance - Ease of use - Ease of creating reusable components - Availability of open source 3rd parties - IDE support
Well, the reason is that the Velocity Engine has been deprecated for a while, and a lot of developers around the world need to find well-fitting alternatives.
Velocity can be used to generate web pages, SQL, PostScript and other output from templates. It can be used either as a standalone utility for generating source code and reports, or as an integrated component of other systems.
Developer file used by Velocity, a Java-based template engine; written using the Velocity Template Language (VTL); contains VTL statements inserted in a normal text document; often used for auto-generating Web source code and class skeletons.
Velocity is a server-side template language used by Confluence to render page content. Velocity allows Java objects to be called alongside standard HTML. If you are are writing a user macro or developing a plugin you may need to modify Velocity content.
@Vartec: I don't think that the "strict separation of view from business logic" is a velocity feature that is not present in jsp. You can do business logic in jsp (more or less) but it's not recommended at all. But I agree in your point regarding the syntax.
Performance
JSP is compiled to Java, so I don't think that velocity is faster. (have not done benchmarks myself)
Ease of use
For designers: velocity For programmers: (IMHO) jsp, because it's closer to code
Ease of creating reusable components
JSP has lots of components Velocity has no components itself (not component oriented)
Availability of open source 3rd parties
I have seen far more projects using JSP or JSP related technologies than velocity. Maybe because velocity is really low level... :-)
IDE support
There are plenty of tools for jsp. Especially the eclipse jboss plugin/tool suite has a good jsp editor.
Plugins for Velocity are mostly not functional or pretty basic (you get lucky if you have syntax highlighting)
Update If you are looking for a templating engine now, I'd suggest to have a look at thymeleaf. It's comparably lightweight to velocity and can be used just to template some text based templates with a few lines of code or used as a full featured templating engine for example within a webapp.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With