SpringSource/spring-mvc-showcase — Issue #5: org.springframework.samples.mvc.form.FormController.processSubmit has invalid ajaxRequest argument.
Author: apogrebnyak
Created: 2011-11-07 23:05:48+00:00
State: open

The argument is not documented in @RequestMapper javadoc -> http://static.springsource.org/spring/docs/3.1.x/javadoc-api/org/springframework/web/bind/annotation/RequestMapping.html.

Also, ajaxRequest is not a request parameter, but a model attribute set by ajaxAttribute method in the same file.

I think, the test for ajax in processSubmit shoud be rewritten like this:

```java
final Boolean isAjaxRequest = (Boolean) model.asMap( ).get( "ajaxRequest" );

if ( isAjaxRequest != null && isAjaxRequest.booleanValue( ) ) {
...
```

And ajaxRequest should be retired from the method signature. Currently it always evaluates to false.