3、测试
public static void main(String[] args) { String s = ESAPI.encoder().encodeForHTML(“ < script > alert(); </ script >”); System.out.println(“对html进行转码:”+s); s = ESAPI.encoder().encodeForSQL(new MySQLCodec(MySQLCodec.Mode.STANDARD),“select * from nihao”); System.out.println(“对MySQL的SQL转码:”+s); s = ESAPI.encoder().decodeForHTML(s); System.out.println(“对html进行解码:”+s); }
4、其他的操作等:
WEB安全-ESAPI_esapi-2.5.2.0-configuration.jar下载-CSDN博客