This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
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

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
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

Joined: Jan 07, 2014
Posts: 29
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!