File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes jsp:attribute - HFJ 472 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "jsp:attribute - HFJ 472" Watch "jsp:attribute - HFJ 472" New topic

jsp:attribute - HFJ 472

Sandeep Krish
Ranch Hand

Joined: Jan 02, 2007
Posts: 59
i've a a tld where <body-content>scriptless</body-content>. So i can have any actions in my tag.

I used the tag in my jsp as given below
<jsp:attribute name="tstAttrib" value="tstValue"/>

As per the note given on the bottom of HFJPage 472 "<jsp:attribute> tag dont count as a 'body content" so the above code must compile. Unfortunately I am getting compiler error "Attribute tstAttrib invalid for tag HTag according to TLD"

Can any of you please help me to sort out what went wrong?
[ November 29, 2007: Message edited by: Sandeep Krish ]
carina caoor
Ranch Hand

Joined: Jun 23, 2007
Posts: 300

<jsp:attribute> do not have an attribute called value give the value in the body of jsp:attribute .....
<jsp:attribute name="user">${param.username}</jsp:attribute>

jsp:attribute attributes are name,trim. there is no value attribute in it.
Sandeep Krish
Ranch Hand

Joined: Jan 02, 2007
Posts: 59
Thank you for reply. I corrected the mistake. Still i get the same exception.
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

How did you declare you tag in the TLD. Did you declare an attribute called "tstAttrib" ?

[My Blog]
All roads lead to JavaRanch
I agree. Here's the link:
subject: jsp:attribute - HFJ 472
It's not a secret anymore!