There are many use cases where you would want to combine both basic and form based authentication when using Spring Security. This was possible with earlier releases of Spring Security but a lot more involved. However, if you can wait for a couple of months for Spring Security 3.1.0 to be released, it can be done by defining multiple http elements in your Spring Security application context file. Multiple http elements couldn't be defined in Spring Security 3.0.X.
The use case we had was to support basic authentication for our REST services, and form based authentication for the same application with a WEB interface.
If you download the Spring Security 3.1.0 M1 release, the PDF also has an example with the same use case scenario.
Add the following http elements in your application context file, change the URL patterns accordingly and you are all set:
Isn't this so simple and easy?