English 中文(简体)
青s的春天安全错误和有限制的夹子没有工作
原标题:spring security error in console and restricted folder is not working

问题1:

i have set up spring security in my application but now i have a little weird problem. what i have learned from spring security is, you dont need to add this line of code @RolesAllowed({"ROLE_ADMIN"}) above your method if you set this up

<sec:http auto-config="true" access-denied-page="/faces/accessDenied.xhtml">
    <sec:form-login login-page="/faces/login.xhtml" />
    <sec:intercept-url pattern="/faces/admin/**" access="ROLE_ADMIN" />
</sec:http>

但显然可以上到“面/行政”夹中的页,而没有春天的安全就把我转往日志上。

问题2:

如果在我的方法之上有@RolesAllowed({“ROLE_ADMIN”}),则该代码将我转至标识页并正确操作,但与这一页相对照,即,在我的波列中,有错误代码(申请仍然正确操作)。 是否是获得治疗的科索沃人否认了青春期的错误,或者说,处理该群岛的最佳途径是什么?

i 仍然希望有限制的页数,不必在行政文件上填写@RolesAllowed

PS:这是一个共同基金2.0项目。

事先感谢che。

最佳回答

问题1:我认为你在你的网络xml上没有授权基金。 类似情况:

<filter>
  <filter-name>springSecurityFilterChain</filter-name>
  <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>

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

并且将以下内容整理成:

<http auto-config="true" >
   <intercept-url pattern="/faces/login.xhtml*" access="IS_AUTHENTICATED_ANONYMOUSLY"/>
   <intercept-url pattern="/faces/admin/**" access="ROLE_ADMIN" />
   <access-denied-handler error-page="/faces/accessDenied.xhtml" />
   <form-login login-page= /faces/login.xhtml  default-target-url= /faces/index.xhtml 
        always-use-default-target= true />
</http>

而不是从上至上页的属性,而是使用从上而下的手,作为上述属性。

问题2:是的,如果你把标识水平确定在德国马克,并且第一次作为匿名用户获得受保护的资源,这是正常的。 见rel=“nofollow”

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签