• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tag files and attributes

 
Henrik Krievs
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • 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
 
Jonatan Samoocha
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • 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?
 
alzamabar
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • 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:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic