JSP vs Velocity what is better?

前端 未结 8 2140
滥情空心
滥情空心 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:28

    I'll focus on using a template engine, because that is what I have most experience with.

    It depends on what you really want to do. Servlets in combination with Velocity (or FreeMarker for that matter) offer a very good seperation of logic and presentation. Templates are harder to test, because you would need to evaluate the template to be able to judge wheter the HTML (or whatever else the output format is) is correct. For JSP this can be done in your IDE of choice.

    The big advantage of templates is that you can store these completely outside of your application and even update them while your application is running. This is something that is a little harder to do with JSP, although hot deployment comes pretty close.

    Reusable components can be created by using the include functionality of the template engine.

提交回复
热议问题