Announcement Announcement Module
No announcement yet.
Autocomplete from database Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Autocomplete from database

    hi ..

    im having a hard time figuring out how to autocomplete a text field from the database..
    i seen few examples in jquery and ajax. but they were writing the database connection and query code in another jsp file and are linking them in the main file.. and im not able to understand whether is it possible to get result like that .

    can u suggest me the correct way of doing it if not the above procedure is correct.
    can u give a simple way so that i can get results implementing it easily..

  • #2
    u can use DWR for AutoComplete. DWR is a AJAX based Framework.


    • #3
      No, you should not code your query inside a jsp. Just put it inside a DAO as usual. Then, in your controller, you can convert between your objects and JSON with Spring's ResponseBody annotation. This way you can easily pick the data from javascript. There are some jquery plugins for autocomplete that make this even simpler.

      You may find this useful: