私はSpring MVCアプリケーションをビルドし、高度なレベルにしました。Spring MVCアプリケーションにセキュリティを統合する(applicationContextの問題)
私の仕事は、Spring Securityをそれに統合することです。そして私は現在、春のセキュリティのためにthis tutorialに従っています。今問題は、私のMVCアプリケーションでは、MVCアプリケーションの親アプリケーションコンテキスト定義であるapplicationContext.xmlが既に存在することです。
セキュリティのチュートリアルで言及しているように、セキュリティのために新しいアプリケーションコンテキストXMLファイルを追加する必要がありますか?コードを含む:
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.4.xsd">
<global-method-security secured-annotations="disabled">
</global-method-security>
<http auto-config="true">
<intercept-url pattern="/**" access="ROLE_USER" />
</http>
<authentication-provider>
<user-service id="userDetailsService">
<user name="username" password="password" authorities="ROLE_USER, ROLE_ADMIN" />
<user name="test" password="test" authorities="ROLE_USER" />
</user-service>
</authentication-provider>
</beans:beans>
ありがとうございます。
P.S. /編集:または私は私の元の/私のMVCアプリケーションの既存のapplicationContext.xmlファイルにコピーする必要がありますか?
ありがとうございました。私はここでは、MVCアプリケーションのweb.xml内のtaglibが別の質問をしています。何のためにこれは何ですか? – AbdulAziz
1)あなたはどんなtaglibについて話していますか? 2)Ralphが指摘しているように、このチュートリアルは古くなっていますので、Spring 3.0を使用してください。 –