You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Serge A. Redchuk" <s....@kse.kiev.ua> on 2002/03/21 12:44:02 UTC

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("&lt;");
                break;
            case '>':
                result.append("&gt;");
                break;
            case '&':
                result.append("&amp;");
                break;
            case '"':
                result.append("&quot;");
                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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>