Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to use tags from taglib in jsp

 
shelly sharma
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using tomcat. I don't know where the taglibrary is stored i.e in which folder and how can i access that library and use it in the jsp pages.
 
vikasids sharma
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
put your .tld files under web-inf directory and .jar files under lib(created under web-inf).
Originally posted by shelly sharma:
i am using tomcat. I don't know where the taglibrary is stored i.e in which folder and how can i access that library and use it in the jsp pages.
 
Nischal Tanna
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
U should store the tld file in the /WEB-INF Folder(the same folder where u should keep ur web.xml) and the jars file in the /WEB-INF/lib Folder.
In the JSP File u can use the tag by using the taglib directive as follows:
<%@ taglib uri="/WEB-INF/mytld.tld" prefix="hello" %>
The prefix is the name in the tld file as declared below..
<taglib>
....
<shortname>hello</shortname> //this is the value of the prefix attribute in the jsp file
<tag>...</tag>
</taglib>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic