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.

Obviously velocity doesn't have access to the session, so I can't get the message out. Is there a way I can get Acegi to populate a model so I can get the message (as well as determine if there was one - param.login_error)?

Comment

Alternatively, you can create a controller that puts the exception on the model and return the VM you want to show (you can use an AbstractController as it doesn't have to do much). In the vm you can check if the exception is empty and if not, print out the message of the exception. You need to specify that controller instead of the VM in the failureURL of the authenticationProcessingFilter and loginFormUrl of the authenticationEntryPoint. Finally, you need to make sure the controller is not secured by the filterInvocationInterceptor.

This is how I got around this problem (and be able to put other things in the model in order to show that in the vm).

Comment

OK. I think I figured out how to do it. What I did (and seems it is working is as follows)

Instead of replacing VM with controller (which will not work since the types mismatch), replacing vm page with URL handeld by the LogonController, which Steffan wrote. Then, it seems everything working fine.