JSP vs Velocity what is better?

flybywire picture flybywire · Mar 4, 2009 · Viewed 28.9k times · Source

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

Answer

Patrick Cornelissen picture Patrick Cornelissen · Mar 23, 2009

@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.