Enlightensoft's Blog

Helping in your each step

  • Categories

  • Authors

Spring Security 3.0 – Part 2

Posted by Pankil Patel on April 12, 2010

How to add method level spring security 3.0 in your project?

Step 1:
Before proceeding for method level in spring security 3.0 basic security should be integrated in your project as explain in Spring Security 3.0 – Part 1

Step 2:
Add “global-method-security” in your applicationContext-security.xml file before “http” tag like:

Step 3:
Add annotation on your method of Spring / Business layer Service.
For example: You have interface “UserDetailService.java” which is implemented by your spring service “UserDetailServiceImpl.java” and you have method called “saveUser” defined in “UserDetailService.java” and implemented in “UserDetailServiceImpl.java” and you want some ROLL Based security on this method so you have to right like this:

Note: Here we are adding method level security into the service file not in the Implementing file.

Hurre…………………….
All set now method level spring security 3.0 is ready to use for your project.

BEST OF LUCK

How to use this ROLL Base spring security to render some JSP / HTML tag?

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: