0
我想只是從屬性文件中獲取一個簡單的值。它適用於我的SpringMVC類,但不適用於我的SavedRequestAwareAuthenticationSuccessHandler
類。春天自動裝置環境
我已經定義:
<context:property-placeholder location="file:/TcatServer6/myapp/properties/myapp/myapp.properties" />
在代碼中,我有:
@Value("${anotherapp_url}")
private String anotherAppURL;
@Autowired
private Environment environment;
在我的Spring MVC控制器,這些工作就好了。在我的彈簧安全登錄處理程序中,這是一個擴展爲SavedRequestAwareAuthenticationSuccessHandler
的類,它們都返回null
。這是我的彈簧security.xml文件
<beans:bean id="adsh" class="com.cs.mytime.agentdesktop.security.ADAuthenticationSuccessHandler"/>
<http auto-config="true">
<intercept-url pattern="/agent/**" access="ROLE_AGENT" />
<form-login
login-page="/r/views/login.html"
authentication-failure-url="/r/views/loginfailed.html"
authentication-success-handler-ref="adsh"
/>
<logout logout-success-url="/logout" />
</http>
我已經通過在互聯網上一噸的東西讀然而,這始終是空,似乎無法得到它的工作。這個不成立。
'spring-security.xml'如何被引導?它是否被包含在其他文件中? – geoand