2013-05-12 25 views

回答

0

SpringSecurity幫助解決了Java EE應用程序的安全問題,如here所述。下面 配置意味着,在您的應用程序的任何URL開始secure訪問該用戶應該有ROLE_SUPERVISOR許可

<security:intercept-url pattern="/secure" method="POST" access="hasRole('ROLE_SUPERVISOR')"/> 

根據您可以使用以下用戶登錄的配置(他們有ROLE_SUPERVISOR許可)

keith/melbourne 
erwin/leuven 

新增

SpringSecurity在Web.xml中由FILT配置呃,它inercepts所有網址:

<filter-mapping> 
    <filter-name>springSecurityFilterChain</filter-name> 
    <url-pattern>/*</url-pattern> 
</filter-mapping> 

所有SpringSecurity是在SpringSecurity配置文件中配置像this

您可以在文件中找到的模式/secure<security:intercept-url pattern="/secure" ...

+0

Thinks for answer,我知道這是,但如果您查看web.xml中的頁面是通過/ spring//spring/*進行映射的,並在文件security-config.xml中查看webflow也會映射到default-target-url =「/ spring/main」,其中「/ secure」映射或config ?, thnks。 – 2013-05-13 14:16:56

+0

SpringSecurity在由濾波器web.xml中配置和它inercepts所有網址:'<濾波器映射> springSecurityFilterChain /* ' – Michael 2013-05-13 18:55:08

+0

答案已更新 – Michael 2013-05-14 09:32:32