JSP vs Velocity what is better?

前端 未结 8 2137
滥情空心
滥情空心 2020-12-25 11:49

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

8条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-25 12:29

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

提交回复
热议问题