*
The moose likes JSP and the fly likes problem while using tagdir Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "problem while using tagdir" Watch "problem while using tagdir" New topic
Author

problem while using tagdir

Vamsi Krishna Kalpuri
Greenhorn

Joined: Jun 08, 2008
Posts: 5
i am unable to use the Tag files. The below is the code and the error message.

hello.jsp:

<%@ taglib prefix="box" tagdir= "/WEB-INF/tags" %>

<HTML>
<HEAD>
<TITLE>Hello Tag</TITLE>
</HEAD>
<BODY>
<box:Header/>
</BODY>
</HTML>


Header.tag in the WEB-INF/tags :

<strong> Hi </strong>

the error that i am getting is

/Hello.jsp(12,0) No tag "Header" defined in tag library imported with prefix "box"


can you please help me. Thank you
Srikanth Nutigattu
Ranch Hand

Joined: Oct 30, 2007
Posts: 114
Nothing seems to be wrong in your code or the tagdir you have specified. I have verified and it is working for me.

check the following

1. The extension is "Header.tag" (case-sensitive)
2. You have placed the tag file under "WEB-INF/tags" of the same application (it may happen sometimes )

apart from that I can't see any problem
sudipto shekhar
Ranch Hand

Joined: Apr 02, 2008
Posts: 823

Which IDE are you using ?


Regards, Sud.
SCJP 5 ScjpFAQ JLS
Srikanth Nutigattu
Ranch Hand

Joined: Oct 30, 2007
Posts: 114
It is not IDE dependent,
Just a straight code would suffice.



head.tag


It is working fine using tomcat 5.
sudipto shekhar
Ranch Hand

Joined: Apr 02, 2008
Posts: 823

If an IDE is being used then where you place your tag files is very important.
Like in eclipse you have to place the .tld file under the TLDs directory under WEB-INF in contrast to what is said that .tld file can be placed directly under WEB-INF of the context-root.
Hence placing the tag files are important as the TAG files could not be found by the container.

So make sure you have placed your tag files under the correct directory structure according to the IDE you are using.
Vamsi Krishna Kalpuri
Greenhorn

Joined: Jun 08, 2008
Posts: 5
Thanks a lot. The example you have given is working fine and also i had tried the old one, now its working fine.

Thank you once again.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: problem while using tagdir
 
Similar Threads
Tag Error
JSP 2.0 tagfile problem
tag files and body content
problem in creating tag library
Exception while using attribute in tag file