Adding Spring Security to Spring MVC project

Hello,

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.

Regards,
Anupam

4 comments

Hello Anupam,

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

You can add required library though in Project Structure dialog:
security.png
Also presence of required Filter in web.xml will be checked from your security-context.xml:
securityxml.png
(please note known bug http://youtrack.jetbrains.com/issue/IDEA-106482 which will be fixed in 12.1.3)

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

Regards,

Yann

0

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 :

spring-security.png

0

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

0

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

0

Please sign in to leave a comment.