<%@ tag language="java" pageEncoding="UTF-8" %>
<%@ attribute name="input" required="true" %>
<%!
private String encodedHtmlTag(String tag){
if ( tag == null) return null;
int length = tag.length();
StringBuilder encodedTag = new StringBuilder( * length);
for( int i =; i < length; i++)
{
char c = tag.charAt(i);
if( c == '<')
encodedTag.append("<");
else if ( c == '>')
encodedTag.append(">");
else if ( c == '&')
encodedTag.append("&");
else if ( c == '"')
encodedTag.append("&qout");
else if ( c == ' ')
encodedTag.append(" ");
else
encodedTag.append(c);
}
return encodedTag.toString();
}
%>
<%=encodedHtmlTag(input) %>