• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using Custom tags

 
S Subramonyan
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am new to JSP and I was learning to use cutom tag libraries.

I get this error, "unable to load class" Heres the code I used.

myForm.jsp:
------------------------
<%@page language="java"%>

<%@taglib prefix="ram" uri="http://localhost/sample.tld" %>

<html>
<body>

Please enter your address and click submit.. <br>
The fileds marked with <ram:required /> are mandatory
</body>
</html>


web.xml
----------------
<taglib>
<taglib-uri>http://localhost/sample.tld</taglib-uri>
<taglib-location>/WEB-INF/jsptags/sampleLib.tld</taglib-location>
</taglib>

Can someone help me out please ?
 
Yorck Zhou
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
you don't have to add the '/WEB-INF/' in the taglib-location element!
the container will add it.

web.xml
----------------
<taglib>
<taglib-uri>http://localhost/sample.tld</taglib-uri>
<taglib-location>/WEB-INF/jsptags/sampleLib.tld</taglib-location>
</taglib>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic