File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Spring and the fly likes Filter configuration in spring security Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Filter configuration in spring security" Watch "Filter configuration in spring security" New topic

Filter configuration in spring security

kuldeep sidhu
Ranch Hand

Joined: Jan 07, 2014
Posts: 33
I am using spring-security for basic login for my application and various levels of access..
In web.xml i have configured the filter as follows

My doubts are as follows-
1. In the above snippet is it necessary to define filter before filtermapping tag? I try reversing the order i was getting some exception filter not found etc..How web.xml is parsed?
2. In url-pattern what is the difference between /, /* and /**.
I tried /** but it was not working. /* is working perfectly.
Surendra Kumar
Ranch Hand

Joined: Jul 04, 2006
Posts: 236
1. Yes. web.xml follows a schema that has to be followed while writing the file (check your web.xml to see xsd location).
2. Yes, /** is not a valid url pattern. /*, /*.do, /admin/* etc. are some valid patterns.
I agree. Here's the link:
subject: Filter configuration in spring security
It's not a secret anymore!