On Fri, 25 Oct 2002, Inge Solvoll wrote:
> > 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. > And this is where I think your assumptions might be challenged. Struts has been around for over two years, released for over 18 months, downloaded many many thousands of times, employed in apps all over the world, and your request is the first I can recall asking for this particular feature. That doesn't imply to me that the need for embedding <br> in the <bean:write> tag's output is a very common requirement. > 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? The obvious answer is not, because that's the way it has always worked. The existing filter attribute is there because it avoids security vulnerabilities (such as cross-site scripting problems from displaying data entered by a user that might contain HTML elements in it) -- it's not there for layout management. > - 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... Even if we were to add this particular type of filtering, you ultimately end up with a limited set of hard coded options. Nesting tags, on the other hand, is extensible to any kind of filtering, and doesn't require modifying ANY of the Struts tags (or any other tags) to make it usable. > - Is the need for filtering linefeeds as common as I think? Or is my webapp > an edge case? As I commented above, this is the first time I can recall ever discussing it with respect to Struts tags. > - Are there other Struts tag that this discussion applies to? > With nesting, it wouldn't matter :-). And it wouldn't matter for non-Struts tags either :-). Craig -- To unsubscribe, e-mail: <mailto:struts-dev-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:struts-dev-help@;jakarta.apache.org>