开发者

What the benefit of using taglib?

开发者 https://www.devze.com 2023-03-13 17:24 出处:网络
I am going to use Spring Web MVC Framework on Netbeans. Writing Web user interface do I really need to use taglib or can I aim the same functionality wit开发者_开发百科h XHTML? Is there any good reaso

I am going to use Spring Web MVC Framework on Netbeans. Writing Web user interface do I really need to use taglib or can I aim the same functionality wit开发者_开发百科h XHTML? Is there any good reason for using taglib? Best regards


You could also use a templating engine like FreeMarker or Velocity. If you wish to not go down a JSP route. Although the Spring tags are pretty good as well.


Taglibs simply equals code re-use that complies with the Don't Repeat Yourself principle.


Use a taglib when you have view logic that would be too difficult or impossible to code using JSTL, and you don't want to use scriptlets (Java embedded in the page). Unfortunately writing a taglib is fairly complex so in practice it's only done when really needed.

Oh yeah, and of course DRY :)

0

精彩评论

暂无评论...
验证码 换一张
取 消