File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes custom tag libraries Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "custom tag libraries" Watch "custom tag libraries" New topic
Author

custom tag libraries

vipul bondugula
Ranch Hand

Joined: Oct 14, 2010
Posts: 218
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


Thanks
Vipul Kumar
Jelle Klap
Bartender

Joined: Mar 10, 2008
Posts: 1836
    
    7

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.


Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
vipul bondugula
Ranch Hand

Joined: Oct 14, 2010
Posts: 218
Thanks Jelle Klap.

vipul bondugula
Ranch Hand

Joined: Oct 14, 2010
Posts: 218
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

Joined: Mar 10, 2008
Posts: 1836
    
    7

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

Joined: Oct 14, 2010
Posts: 218
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!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: custom tag libraries