• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Tag files and attributes

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

Tag files can have attributes, right ? And if you've got a large attrib you can put it in the body and access it with jsp.doBody.

But that must mean you can have only ONE large attrib pr. tagfile ?

Or put it otherwise; you can't put more than one attrib in the body of the tagfile ??

Rgds, Henri
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Henrik,

in a strict sense, an (XML) attribute cannot be used within the body of a tag, so I assume that with "attribute" you mean something like "data to be sent to the tag file".

I think the HF book uses an example of passing a "large attribute" (a large chunk of text) through the tag's body.

If you want to pass multiple (large) objects to a tag file, IMO there are two ways to achieve this:

1. Wrap your "large attribute" into an object and pass it as an (XML) attribute of your tag.
2. Use other (nested) custom tags to pass multiple large pieces of text to the outer tag, e.g.


Does this answer your question?
 
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is the benefit of using Tag Files only a different naming convention to include other pages into the requesting one? I can see the benefit of using:

<navigation:topBar />

<navigation:leftBar />

instead of

<%@ include file=... %> or <jsp:include page=...> or <c:import url...>

But is this really the only advantage of Tag Files? I'd expect something more.
:roll:
 
reply
    Bookmark Topic Watch Topic
  • New Topic