[prev in list] [next in list] [prev in thread] [next in thread]
List: taglibs-user
Subject: Re: Suppress whitespace generation?
From: Steve Morrison <steve.morrison () verizon ! com>
Date: 2002-02-27 17:25:49
[Download RAW message or body]
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:clomvardias@syscom.com]
> > Sent: Tuesday, February 19, 2002 1:27 PM
> > To: 'taglibs-user@jakarta.apache.org'
> > Subject: Suppress whitespace generation?
> >
> >
> > Hi,
> >
> > How does one suppress whitespace that is generated by a tag library?
> >
> > Thanks,
> >
> > Chris
> > ------------------------------------------------------------------
> > Chris Lomvardias
> > clomvardias@syscom.com
> > PublicBuy.Net
> > 400 E. Pratt Street, Suite 300
> > Baltimore, MD 21202
> > (410)539-3737 x1722 voice
> > (410)539-7302 fax
> > 4439941549@mobile.att.net (pager via email)
> > ------------------------------------------------------------------
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> > <mailto:taglibs-user-help@jakarta.apache.org>
> >
> > --
> > To unsubscribe, e-mail: <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: <mailto:taglibs-user-help@jakarta.apache.org>
> >
>
> --
> To unsubscribe, e-mail: <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:taglibs-user-help@jakarta.apache.org>
--
To unsubscribe, e-mail: <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-user-help@jakarta.apache.org>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic