Signup · Login
Stardeveloper.com  
Home · Tutorials · Forums · ASP.NET Newsletter Application · Web Hosting Plans · Faisal Khan's Blog · Contact
Forums : J2EE : JSP : where is web.xml role Signup · Login
Author Thread
where is web.xml role
Posted in tutorial: Building Your first custom JSP Tag
·  satiri
User
Joined: 28 Apr 2004
Total Posts: 1

where is web.xml role

Posted: 28 Apr 2004
I have read such article that include web.xml to define the taglib. As a begginer I would like to know on why we need to use web.xml to define the taglibs.
·  hb_butalia
User
Joined: 6 Jul 2004
Total Posts: 1
reply where is web.xml role
Posted: 6 Jul 2004
The role of web.xml is very simple .

For example
<%@ taglib uri="/WEB-INF/jsp/mytaglib.tld"
prefix="first" %>

if u dont do an enrty in web.xml u need to mention the path (uri) of the tag in every jsp.This is a bad practice as to if at any point of time u need to change the location of ur tag library u need to change the path in every jsp where it has been used.


This is the entry in web.xml

<taglib>
<taglib-uri>mytags</taglib-uri>
<taglib-location>
/WEB-INF/jsp/taglib.tld
</taglib-location>
</taglib>

after u make theentry in web.xml the above tag directive looks like this

<%@ taglib uri="mytags"
prefix="first" %>
Want to leave a comment? Login or Register for free!

Users Who Have Visited This Thread In Last 24 Hours
1 Visitor

Login to post a comment or start a new thread
UserName Or Email Address:       Password:       Auto-Login:    
· Create New User Account
· Send Forgotten Password by Email
 
© 1999 - 2010 Stardeveloper.com, All Rights Reserved.