处理xss攻击
前端处理方法: function checkXSS(param){ var pattern = /<[^>]+>|alert(.*)/; var str = “”; $("[id=’"+ param +"’]").each(function () { str += $(this).val(); }); if (pattern.test(str)){ $.umapMessager.alert([[#{common.hint}]], [[#{config.cvalue.validate}]]); return true; } } 后端加过滤器的例子: @PropertySource(value = {“classpath:security.properties”}) @ConfigurationProperties(prefix = “security”) @Component @Data public class SecurityParam { private String antiparam; private String whiteparam; } security.properties: #antiparam xcc/css security.antiparam=<,>,%3c,set-cookie,src="javascript:,ProcessBuilder,alert(