java Spring配置无法扩展属性
我正试图通过属性文件启用或禁用授权。但下面的方法行不通
<global-method-security pre-post-annotations="${enabled}" />
xml验证失败
在此行找到多个批注: -cvc枚举有效:值“${enabled}”对于枚举“[disabled,enabled]”无效。它必须是来自 枚举
有人能给我建议正确的方法吗
你可以在下面搜索框中键入要查询的问题!
我正试图通过属性文件启用或禁用授权。但下面的方法行不通
<global-method-security pre-post-annotations="${enabled}" />
xml验证失败
在此行找到多个批注: -cvc枚举有效:值“${enabled}”对于枚举“[disabled,enabled]”无效。它必须是来自 枚举
有人能给我建议正确的方法吗
# 1 楼答案
不幸的是,Spring Security XSDs硬编码了该(和其他)属性IIRC的可能值:
因此,如果希望XML验证成功,就不可能进行属性替换(因为XML验证不知道Spring的替换标记)