I suggest the <choose> tag in the jstl (and probably other tags as well) should 
trim their content.  Considering:
<c:choose>
  <c:when test="$param:foo == 'bar1'">...</c:when>
  <c:when test="$param:foo == 'bar2'">...</c:when>
  <c:when test="$param:foo == 'bar3'">...</c:when>
  <c:otherwise>...</c:otherwise>
</c:choose>
produces 5 unnecessary newlines and spaces.  Since you never expect content to be
between a <choose> and a <when> or <otherwise> it's probably ok to remove it.

-Steve


Shawn Bayern wrote:
> 
> Hi Chris,
> 
> The question is somewhat general.  For instance, depending on your needs,
> you can write a tag that trims its BodyContent (using String.trim()) and
> simply contain other tags within it.  So that:
> 
>   <foo:trim>
> 
>      foo
> 
>   </foo:trim>
> 
> would produce equivalent output to
> 
>   <foo:trim>foo</foo:trim>
> 
> If you're suggesting, by contrast, that a particular taglib in Jakarta
> Taglibs produces unwanted whitespce, let us know, and the tag libraries
> could be patched to avoid this, or (as in the case of the Input taglib) to
> take a flag that switches behavior between "pretty printing" and avoidance
> of unnecessary whitespace.
> 
> To help you further, I think we'd need more information about exactly what
> problem you're experiencing.
> 
> --
> Shawn Bayern
> Author, "JSP Standard Tag Library"  http://www.jstlbook.com
> (coming this spring from Manning Publications)
> 
> On Wed, 27 Feb 2002, Lomvardias, Christopher wrote:
> 
> > Haven't heard any responses to my earlier question below. Thought I'd poke
> > the list again.
> >
> > Chris
> >
> > -----Original Message-----
> > From: Lomvardias, Christopher [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, February 19, 2002 1:27 PM
> > To: '[EMAIL PROTECTED]'
> > Subject: Suppress whitespace generation?
> >
> >
> > Hi,
> >
> > How does one suppress whitespace that is generated by a tag library?
> >
> > Thanks,
> >
> > Chris
> > ------------------------------------------------------------------
> > Chris Lomvardias
> > [EMAIL PROTECTED]
> > PublicBuy.Net
> > 400 E. Pratt Street, Suite 300
> > Baltimore, MD 21202
> > (410)539-3737 x1722 voice
> > (410)539-7302 fax
> > [EMAIL PROTECTED] (pager via email)
> > ------------------------------------------------------------------
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> >
> > --
> > To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> >
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to