Adding Spring Security to Spring MVC project


I have tried creating a new Spring Security project via the New Project wizard and it works great.  

However, when i have a existing Spring MVC project, i am unable to add Spring Security to it by either adding it as a Framework support or as a Facet support. Is it by design, or is my IDE not setup properly?  

Once again (just to make it clearer), my requirement is to add Spring Security support (appropriate configuration and controller handlers to be created automatically) to an existing Spring web mvc project.

I am aware of the alternative way to add dependencies via maven and then code the handlers and configuration myself manually but i am looking for a more IDE way.


Comment actions Permalink

Hello Anupam,

for Spring Security there is no "setup wizard" like for Spring MVC.

You can add required library though in Project Structure dialog:
Also presence of required Filter in web.xml will be checked from your security-context.xml:
(please note known bug which will be fixed in 12.1.3)

If you have any other ideas or proposals, please let us know.



Comment actions Permalink

Hi Yann,

Actually, i figured out that we can create a Spring Security project via the setup wizard. No need to add security separately to Spring MVC. The wizard creates a mvc project all setup with the right security configuration which suffices my requirement :)

Please see screenshot below to see what am i referring to :


Comment actions Permalink

OK, that of course is possible. I thought you were referring to integration of Spring Security in non-Spring MVC projects.

Comment actions Permalink

Thanks for confirming and the responses. Marking this closed. :)


Please sign in to leave a comment.