在数据存入数据库之前应该会对数据进行转义为"等样式,如果包含有&就时经过两次加密的,所以转义的时候也需要经过两次转义。
public static void main(String[] args) {
String q="title="1575442163508050696.jpg"/>";
URLDecoder.decode(q);
StringEscapeUtils.unescapeHtml(q);
System.out.println("333:"+URLDecoder.decode(q));
System.out.println("4444:"+StringEscapeUtils.unescapeHtml(StringEscapeUtils.unescapeHtml(q)));
}
运行结果如下: