views:

162

answers:

1

Except for this article http://blog.springsource.com/2010/01/25/ajax-simplifications-in-spring-3-0/

I cannot find any good examples of the new AJAX related features in Spring 3.0. I am interested in how the web application build utilizing Spring MVC with Annotations can be integrated with the various AJAX frameworks, such as Dojo to provide rich user experience on the front end.

+2  A: 

I think the article is pretty clear about the options. For example, based on it, I created the following method for verifying whether a username is in use or not:

/**
 * @param username
 * @return true if the username is free, false otherwise
 */
@RequestMapping("/account/checkUsername/{username}")
@ResponseBody
public boolean checkUsername(@PathVariable("username") String username) {
    return userService.checkUsername(username);
}

And on the client side, using jQuery:

$("#username").live("blur", function() {
    $.getJSON("account/checkUsername/" + $("#username").val(),
        function(response) {
            // do something with JSON response
        }
    );
});
Bozho
This is fine if I want and can use jQuery. But if I want to use Dojo or DWR, it is not clear to me how to integrate those very popular frameworks with Spring 3 and whether the new version makes that integration any easier.
LeoNYC
well, it's would be similar with any framework that supports getting JSON responses via AJAX.
Bozho