• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Custom tags: telling the developer the attributes

 
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

The way to tell the jsp developer what attributes the tag is requiring
is to make a tld and mention these things. Suppose I don't have tag handler
class, I get the error that not able to load tad handler class. Is <tag-class> must?
If I only want to tell certain attributes that are must to add from the jsp
while using the tag. What to do for that?


Please help!

Thanks,
[ June 06, 2007: Message edited by: Chandra Bhatt ]
 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
here is the dtd of tag element

<!ELEMENT tag (name, tag-class, tei-class?, body-content?,
display-name?, small-icon?, large-icon?,
description?, variable*, attribute*, example?) >

it shows that tag-class is must.
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ghufran,

Could you please focus more light on this? I only know that in the .tld
file we give the detail to the jsp builder what attributes the tag requires.



Thanks,
 
Ghufran Ul Haq
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

The .tld is not only for the jsp developer but it is also for the jsp container.
The Tag library Developer must provide the attributes list in .tld.
or one can use the dynamic-attribute element

Thanks
Ghufran
 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not too sure if i understand your question correctly, but here is an attempt to answer

You said you are not using a tag handler, so you don't have a tag-class, so i assume you must be having a <filename>.tag under WEB-INF/tags.

The developer can get the attribute information from the tag file itself
<%@ attribute name="attr" required="true" rtexprvalue="true" %>.

TLD lets you mention the location of your tag file (but thats just the location)


<tag-file> tld element has the following attributes

description
display-name
icon
name
path
example

As you can see there is no place for attribute which is available in the tag tld element.

Further reading
Tag Library Descriptors
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Swarna,

You got my question correctly. Actually I was referring to HFSJ page number
495, under the bubble thought "...where's the TLD that describes the attribte
type?"


Anymore information is solicited!



Thanks,
 
reply
    Bookmark Topic Watch Topic
  • New Topic