protected String sanitize(String s){
  String result;
  result=s;
  result=result.replaceAll("&","&amp;");
  result=result.replaceAll("<","&lt;");
  result=result.replaceAll(">","&gt;");
  result=result.replaceAll("\"","&quot;");
  return result;
}

protected String sanitize ( String s ) { String result ; result = s ; result = result . replaceAll ( "&" , "&amp;" ) ; result = result . replaceAll ( "<" , "&lt;" ) ; result = result . replaceAll ( ">" , "&gt;" ) ; result = result . replaceAll ( "\"" , "&quot;" ) ; return result ; }
replaces certain characters with their html entities .
