• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

custom tag libraries

 
vipul bondugula
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

currently i am working on custom tag libraries. i wrote a tag library and tried to configure it in web.xml. but <taglib> is not allowed in web.xml. I am using servlet 2.5 specification. please guide me.

Thanks
Vipul Kumar
 
Jelle Klap
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Including taglib elements in the web.xml deployment descriptor is hardly ever necessary. If the .tld files are in the right location they will be discovered 'automagically'.
Anyway, as of version 2.4 of the servlet specification the xml schema definition for web.xml has changed and become more stringent. You can still add taglib elements to it, but the must be child elements of a parent element called jsp-config. Though I'd recommend you simply put the .tld files in the proper location for auto-discovery, and not include them in the web.xml explicitly.
 
vipul bondugula
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jelle Klap.

 
vipul bondugula
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I kept the tld file in WEB-INF folder. i used uri in tld file to locate the tld. It worked.

Thanks Jelle klap.

can you also tell me what are the other places where we can keep our tld files so that server automatically detects.

Thanks,
Vipul Kumar.
 
Jelle Klap
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well in the WEB-INF folder, as you already figured out, but also any subfolder of WEB-INF.
There's also the option of including .tld files in the META-INF folder inside JAR files in WEB-INF/lib.
 
vipul bondugula
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jelle Klap wrote:Well in the WEB-INF folder, as you already figured out, but also any subfolder of WEB-INF.
There's also the option of including .tld files in the META-INF folder inside JAR files in WEB-INF/lib.


Thank You Very Much!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic