我有以下代码:
var shpa = "<sprSec:authentication property="principal.username" />";
它呈现为
var shpa = "mihailov-ta+spam33@ya.ru";
问题看起来像是转义。它应该呈现如下:
var shpa = "mihailov-ta+spam33@ya.ru";
如何根据我的要求对其进行编码?
最佳答案
您应该使用sprSec:authentication的htmlEscape属性。请参阅that .
示例:
<sprSec:authentication property="principal.username" htmlEscape=false />
关于java - spring security 因用户名问题而转义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27688106/