Java has java.net.URLEncoder class, but that is for encoding URLs, to do HTMLEncode, create your function, for example:
http://www.rgagnon.com/javadetails/java-0306.html
http://www.rgagnon.com/javadetails/java-0306.html
除了26个字母以外统统视为非法为好