This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.
You would probably be better doing something like that outside Spring Security. If you're using apache, then do it there. Or use a security-constraint in your web.xml to do it. Search the web and you will find plenty of examples.