弹出安全性逃避用户名问题

时间:2014-12-29 11:36:41

标签: java encoding spring-security escaping

我有以下代码:

var shpa =  "<sprSec:authentication property="principal.username" />";

它呈现为

var shpa = "mihailov&#45;ta&#43;spam33&#64;ya&#46;ru";

问题看起来像是逃避。它应该呈现为:

var shpa = "mihailov-ta+spam33@ya.ru";

如何根据我的要求对其进行编码?

1 个答案:

答案 0 :(得分:1)

您应该使用 sprSec:authentication htmlEscape 属性。见that
例如:
<sprSec:authentication property="principal.username" htmlEscape=false />