【问题标题】:example booking faces intercept-url pattern="/secure"示例预订面孔 intercept-url pattern="/secure"
【发布时间】:2013-05-22 23:05:10
【问题描述】:

我有一个与示例booking-faces 相关的问题,参数在spring security intercept-url pattern="/secure" 什么是映射?,/secure 配置在哪里。 谢谢。

【问题讨论】:

  • 你想让我更好地澄清我的答案吗?

标签: spring spring-security spring-webflow


【解决方案1】:

SpringSecurity 有助于解决 Java EE 应用程序的安全问题,如 here 所述。 下面的配置意味着在您的应用程序中访问任何以secure 开头的 URL 的用户应该具有ROLE_SUPERVISOR 权限

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

根据配置可以使用以下用户登录(有ROLE_SUPERVISOR权限)

keith/melbourne
erwin/leuven

已添加

SpringSecurity 是通过过滤器在 Web.xml 中配置的,它不接收所有 URL:

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

所有 SpringSecurity 都在 SpringSecurity 配置文件中配置,如this

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

【讨论】:

  • 感谢回答,我知道是这样,但是如果您查看 web.xml,页面是由 /spring/ /spring/* 映射的,并且在文件 security-config.xml 中,您会看到 webflow 正在与 default-target-url="/spring/main" 进行映射,“/secure”映射或配置在哪里?,谢谢。
  • SpringSecurity 通过过滤器在 Web.xml 中配置,它不接收所有 URL:&lt;filter-mapping&gt; &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt; &lt;url-pattern&gt;/*&lt;/url-pattern&gt; &lt;/filter-mapping&gt;
  • 是的,过滤器当然会拦截所有的url,但是如果你在web.xml中查看所有页面都是这样localhost:8080/spring-webflow-samples/spring/xxx.xhtml开始的,流程就像/spring/main.xml我不'看不到 /secure 的配置位置。
  • 可能是我错过了你的问题,但是SpringSecurity的配置如下:1)你在web.xml中添加springSecurityFilterChain 2)你在SpringSecurity配置文件中配置所有人员:github.com/SpringSource/spring-webflow-samples/blob/master/…你可以找到在文件中模式为secure:&lt;security:intercept-url pattern="/secure"
猜你喜欢
  • 2011-12-20
  • 2011-10-16
  • 2015-02-10
  • 2015-01-23
  • 2012-08-03
  • 2013-02-03
  • 2012-07-17
  • 2011-11-27
  • 1970-01-01
相关资源
最近更新 更多