I agree with you on most of this. I can clearly see that it is hard to draw the line when to stop filtering in the bean:write tag and other tags and leave this to other taglibs.

The current filter functionality that escapes html is also basically functionality that could have been done by some tag in JSTL. But for functionality that is very common, I think it is reasonable to focus on convenience rather than design principles.

If you agree with this, the interesting discussion here then is:
- What is the more common case when outputting text with the bean:write tag? To view the text with visible linefeeds as inputted by the user, or not?
- Are there other filtering tasks that are equally common as this? If there are, it would be less reasonable to insert linefeed filtering, as you said, as it would cause a storm of filtering requests...
- Is the need for filtering linefeeds as common as I think? Or is my webapp an edge case?
- Are there other Struts tag that this discussion applies to?

At 17:41 24.10.2002 -0400, you wrote:
IMHO, once we opened the door past the filter
attribute, people would suggest that we start
adding this or that to the bean write tag as well.

I would say that any transformations beyond the
escape filter really belong on some other tag.

IMHO, a better place for a tag like this is
Taglibs. This functionality does not involve the
core framework directly, and the effort may get
more exposure in taglibs than here.

Also, IMHO, we should encourage people to look to
Taglibs for general-purpose tags. Post 1.1, we
might seriously consider migrating the bean,
logic, tile, and template packages to Taglibs (if
they will have them), where it can stand toe-to-
toe with JSTL.

This would let us focus on the HTML tags that
interact with the framework, and leave the generic
functionality to the (other) Jakarta community
that specializes in such things.

But if someone supplies the patch, and a Committer
applies it, like Craig, I'm +0 on the deal.

-Ted.

10/24/2002 5:12:19 AM, Inge Solvoll
<[EMAIL PROTECTED]> wrote:

>I actually didn't think of creating a tag that
can be wrapped around the
>bean:write tag, that's obviously the best
solution for me. I'll check if
>there is something like that in Jakarta taglib. I
believe someone here
>mentioned a 'replace' tag.
>
>But, for me this is still an interesting
question. The web application I'm
>working on is very big and has a lot of text
input and output. All of our
>inputted text should preserve linebreaks. Text
entered in regular text
>fields doesn't have linebreaks anyway, and text
from textareas should have
>breaks. I see that it isn't too pretty code to
always insert BR-tags in
>bean:write, but couldn't this at least be an
option, like this:
>
>bean:write name="myBean" property="myProp"
preserveLineFeed="false",
>
>where preserveLineFeed would be true by default?
The tag would then use a
>method like the breakNewlines(String) method
suggested below.
>
>For my web application this would be far more
elegant than wrapping another
>custom tag around every single bean:write that
needs to preserve line
>breaks. As I said, the need to preserve
linebreaks is very common in my
>experience, I rarely want to NOT preserve
linebreaks... At least for me
>because most of the text that is outputted is
text inputted by a user in a
>textfield or textarea.
>
>The bean:write tag already has an attribute
"filter" that escapes
>HTML-formatting, which in my opinion covers the
same kind of thing, how the
>output looks when rendered in html, why is it not
elegant to do the same
>thing for linebreaks?
>
>At 12:02 23.10.2002 -0500, you wrote:
>>There are already taglibs that do this
transformation, aren't there?
>>Doesn't the taglibs project have things that
address this?  Is there a way
>>to do this using the JSTL (Martin?)?
>>
>>David Graham wrote:
>>
>>>If this is a common problem, maybe we could add
a method to Action like
>>>breakNewLines(String) that does this
transformation.  The <bean:write>
>>>tag should not do any transformation, just
display what it's given.
>>>
>>>What do you think?
>>>
>>>Dave
>>
>>
>>--
>>Eddie Bush
>>
>>
>>
>>
>>--
>>To unsubscribe, e-mail:   <mailto:struts-dev-
[EMAIL PROTECTED]>
>>For additional commands, e-mail: <mailto:struts-
[EMAIL PROTECTED]>
>
>
>--
>To unsubscribe, e-mail:   <mailto:struts-dev-
[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:struts-
[EMAIL PROTECTED]>
>
>






--
To unsubscribe, e-mail:   <mailto:struts-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-dev-help@;jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:struts-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-dev-help@;jakarta.apache.org>

Reply via email to