public static String encode(String value){
  value=value.replace("&","&amp;");
  value=value.replace("<","&lt;");
  value=value.replace(">","&gt;");
  value=value.replace("\"","&quot;");
  value=value.replace("'","&#x27;");
  value=value.replace("/","&#x2F;");
  return value;
}

public static String encode ( String value ) { value = value . replace ( "&" , "&amp;" ) ; value = value . replace ( "<" , "&lt;" ) ; value = value . replace ( ">" , "&gt;" ) ; value = value . replace ( "\"" , "&quot;" ) ; value = value . replace ( "'" , "&#x27;" ) ; value = value . replace ( "/" , "&#x2F;" ) ; return value ; }
html encodes value to avoid xss attacks . & = & amp ; < = & lt ; > = & gt ; " = & quot ; ' = & # x27 ; / = & # x2f ;
