Integrating Appfuse and AjaxTags autocomplete: a short tutorial

This brief tutorial shows how to integrate Appfuse and the AjaxTags library to create a simple Ajax autocomplete effect on a JSP page. The autocomplete function is integrated into a simple JSP page and is used to complete the usernames of users stored in the database.
Hopefully, it should be easy to extend the code presented here to apply the autocompletition capability to other part of an Appfuse based application.
The tutorial is based on the Spring version of Appfuse 1.9.2 and AjaxTags 1.2. If you are using a different Appfuse compatible MVC frameworks other then Spring MVC, this tutorial will not work 100%. I have tried to keep things simple, so a basic knowledge of Appfuse should be enough.
During this tutorial I will use %APPFUSE% to reference the "HOME" folder of your Appfuse based application.

Configuration

Code

Et voilą...

That's pretty much it. To test the autocompletition functionality build and deploy your app and browse to
http://localhost:8080/myapp/ajaxFrontDemo.html
(assuming that you are deploying on Tomcat and your app is called "myapp").
The "ajaxFrontDemo" action is a dummy action of the AjaxFrontController that simply redirect the user to the demo jsp page. In real life, you will probably need to add a BaseFormController to handle your form submission logic.


The autocomplete text box!