1.跨域
response.setHeader("Access-Control-Allow-Origin", request.getHeader("Origin")); response.setHeader("Access-Control-Allow-Headers", "Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With,userId,token"); response.setHeader("Access-Control-Allow-Credentials", "true");
2.正则去掉所有css样式
public String regClass(String str){ String reg = "([^\s=]+)=(['"\s]?)([^'"]+)\2(?=\s|$|>)"; Pattern p = Pattern.compile(reg); Matcher matcher = p.matcher(str); return matcher.replaceAll("").replaceAll(" ", ""); }