开发者

What is a JSP tag?

开发者 https://www.devze.com 2022-12-19 12:16 出处:网络
I\'m coming from开发者_开发技巧 a .NET background and trying to learn Java. I keep seeing references to tags and tag handlers, etc.

I'm coming from开发者_开发技巧 a .NET background and trying to learn Java. I keep seeing references to tags and tag handlers, etc.

Is there an equivalent .NET construct?


Yes. <% ... %> is what you get for the jsp tag. Tag Handlers are similar to the RUNAT="SERVER" attribute you can add to many HTML tags, except they go much further and allow you to create custom tags to fit your needs. For example you could create a tag called DATETIMEHERE that when encountered simply output the date/time.

E.g.

<span class="somsCSSClass"><DATETIMEHERE /></span>

In ASP.NET MVC you could create a custom ViewEngine and do something as robust as Tag Handlers very easily.

0

精彩评论

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