pp jai
pp jai

Reputation: 29

Spring security integration without using annotation

I have to integrate spring security to my application. I didn't use annotation for mapping, Simply did all the mappings using application-Context.xml. Now I want to integrate spring security, So I followed this tutorial http://krams915.blogspot.com/2010/12/spring-security-mvc-integration_18.html in this they are using annotation based spring security. But I want to do the same without using annotation.

Thanks in Advance..

Upvotes: 0

Views: 1719

Answers (2)

Pavan
Pavan

Reputation: 3425

I don't find any annotations regarding spring security in the tutorial you specified , "spring-security.xml" is all that you want in that tutorial.you can find here also.Spring provides annotations for method security only,even though you can use protect-pointcut for securing methods.For example

 <global-method-security>
    <protect-pointcut expression="execution(* *..service.UserManager.getUsers(..))" access="ROLE_ADMIN"/>
  </global-method-security>

according to above pointcut,only users with the ROLE_ADMIN role will be able to invoke thes UserManager's clss getUsers() method.

Upvotes: 1

Simeon
Simeon

Reputation: 7792

You should be able to use the protect-pointcut element in your namespace configuration.

Here's how.

Also if your doing it for the first time I strongly recommend doing this tutorial first.

Upvotes: 1

Related Questions