Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Custom tag scenario  RSS feed

 
Arjun Reddy
Ranch Hand
Posts: 629
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Can someone give me a real world scenario as how to use custom tags for a particular web based application?

Thanks.
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37222
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Arjun,
Common code meant to be reused makes for a good tag library (or tag file.) For example, a navigation menu widget.
 
Arjun Reddy
Ranch Hand
Posts: 629
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne Boyarsky wrote:Arjun,
Common code meant to be reused makes for a good tag library (or tag file.) For example, a navigation menu widget.


Thanks Jeanne. Can you give me any other example maybe?
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, suppose, you have a web form, and a usual formatting is something like below,



So, for this you can write a custom tag, which looks something like this in use,



and render something like above. I hope you get the point. For more you can refer to JSP Custom Tag Tutorial.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!