• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt regarding Tag file attribute!!

 
Prabhat Gupta
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
I have created a Header.tag file and placed it into the WEB-INF/tags directory.In other myTagImport.jsp file when i am declaring as
<%@ taglib prefix="mine" tagdir="/WEB-INF/tags" %>
<mine:Header/> it works fine and place the Header.tag file but the problem is
when an attribute is being added as

<mine:Header author="Prabhat" /> it shows exception saying Attribute author invalid for tag Header according to TLD . Although i havn't defined any .tld file for the same.

Please suggest where i am wrong?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Header.tag, did you declare the attribute using an attribute directive (or using dynamic attributes ?)

By the way, I recommend you to keep filenames in lowercase -> header.tag
 
Prabhat Gupta
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah im my Header.tag file i have declared as

<font color="green">Header.tag</font><br>
the author name is ${author}

Please tell what is wrong here?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The attribute directive is missing :
<%@ attribute name="author" required="true"%>
or
<%@ attribute name="author" required="false"%>
 
Prabhat Gupta
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Christophe,
Yeah i didn't know about attribute directive now it is working fine.

Thanks a lot again.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic