Note that there are some explanatory texts on larger screens.

plurals
  1. POWhere can I find more information on spring-security annotations
    text
    copied!<p>I am currently working on securing a web application using spring-security 3.0. I have gotten most of my issues figured out but I am trying to gain a better understanding of exactly what I am doing (copy and paste FTL). </p> <p>I watched <a href="http://www.viddler.com/explore/oredev/videos/22/" rel="nofollow noreferrer">this video</a> in which he stated that the @Secured should not be used anymore except for certain situations. He also shows a list of annotations and methods that can be used (around 44:50) but doesnt explain them. He simply shows them being used. So I took a look through the documentation and found <a href="http://static.springsource.org/spring-security/site/docs/3.0.x/reference/ns-config.html#ns-method-security" rel="nofollow noreferrer">this</a>. So I add the required code to my xml file, and I try <code>@PreAuthorize("hasAuthority('ROLE_ADMIN')")</code> and it doesn't work. I then realize that hasAuthority is not a method (thank you documentation for confusing me). I change it to <code>@PreAuthorize("hasRole('ROLE_ADMIN')")</code> and VOILA, it works.</p> <p>Now, I'm wondering (other then why is the documentation wrong) where can I find more information on the pre-post-annotation types and methods that were so nicely listed in the presentation? I tried the Google but maybe I'm searching for the wrong terms. Also, JSR250 annotations were mentioned as being the proper ones to use but I have found no information on this either. Is my google broken or am I simply looking in the wrong places?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload