Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Servlets and the fly likes jQuery Autocomplete servlet/jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "jQuery Autocomplete servlet/jsp" Watch "jQuery Autocomplete servlet/jsp" New topic
Author

jQuery Autocomplete servlet/jsp

Nicolas Constanzo
Greenhorn

Joined: Jul 10, 2011
Posts: 4
Hi everyone,
I've been looking all around for an efficient way to implement the jquery autocomplete javascript on my website but so far I haven't been able to make it work.
What I want to do is to have a text field that when the user starts typing, a search of the database will be made and the user would be given "suggestions".
Considering that I currently use servlets to fill the data on most of my jsp pages, I thought maybe I could use a servlet that could call on a DAO.
Like so:
String sql = "SELECT name FROM User WHERE name LIKE '"+str+"%';
Or should the texbox already know which values to select from?

Is this the way I should be approaching this? Because so far all of the tutorials I have found so far haven't worked for me. I don't know PHP or JSON if that's needed to do this.

Any help on this would be greatly appreciated, I have been looking everywhere!

Thanks in advance,
Nick
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jQuery Autocomplete servlet/jsp
 
Similar Threads
Getting started with Portals...
Directory Chooser
struts, .click, names, jQuery
Making all of a certain id have .click()
What's next after servlets?