The function of this method is to conveniently ensure that the text you're writing does not break or invalidate your HTML/XHTML/XML.
E.g. convert "x <= y" to "x <= y" so that an XML processor can process it (otherwise it could just throw an error). However, if you converted "two lines" to "two <br> lines" or "two <br/> lines" it could break some folks XML as <br> may not be a valid tag. You should look elsewhere for HTML specific tools. I don't know of any I'm afraid. Andy. > -----Original Message----- > From: Serge A. Redchuk [mailto:[EMAIL PROTECTED]] > Sent: 21 March 2002 11:44 > To: [EMAIL PROTECTED] > Subject: BUG in org.apache.struts.util.ResponseUtils.filter(String > value) method in v.1.0.2 > > > Hello all ! > > I think there is a bug in BUG in > org.apache.struts.util.ResponseUtils.filter(String value) > method in v.1.0.2 > > This useful method states: > > public static String filter(String value) { > > if (value == null) > return (null); > > char content[] = new char[value.length()]; > value.getChars(0, value.length(), content, 0); > StringBuffer result = new StringBuffer(content.length + 50); > for (int i = 0; i < content.length; i++) { > switch (content[i]) { > case '<': > result.append("<"); > break; > case '>': > result.append(">"); > break; > case '&': > result.append("&"); > break; > case '"': > result.append("""); > break; > default: > result.append(content[i]); > } > } > return (result.toString()); > > } > > All ok, but why this method does not converts '\n' to <br> ? > > > -- > 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]>