aspose file tools*
The moose likes Struts and the fly likes Autocomplete search with Struts and Hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Autocomplete search with Struts and Hibernate " Watch "Autocomplete search with Struts and Hibernate " New topic
Author

Autocomplete search with Struts and Hibernate

M Marin
Ranch Hand

Joined: Feb 20, 2010
Posts: 32
Hello everybody,

I am using for my project Struts 2 and Hibernate/Spring dependency injection. My project is just a simple CRUD application. I am trying to implement an autocomplete search of data in the database, but I am not sure which is the most appropriate approach using the above framewors(I am new to them). If anyone can point me to a working example using the framewors or give me any ideas.

Thank you.

MJ
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I'd use an existing implementation, like jQuery's or equivalent, rather than writing one.

Wait, ORM forum? That's a bit off. Moving.
Richard Golebiowski
Ranch Hand

Joined: May 05, 2010
Posts: 213

My personal favourites are the Struts Autocompleter and the AjaxTags Autocomplete.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

(If you're talking about the S2 jQuery tags, okay, but if we're talking about the Dojo tags, they're deprecated, are not supported, and use a *very* old version of Dojo. I cannot recommend them.)
Richard Golebiowski
Ranch Hand

Joined: May 05, 2010
Posts: 213

David, I agree with what you said. Actually, between the two I mentioned I mostly use the AjaxTags. I went with Ajaxtags because it is a technology that was currently being used where I work. For someone looking for an autocompleter there are a lot of choices out there so just do your research and pick one that your comfortable with.
M Marin
Ranch Hand

Joined: Feb 20, 2010
Posts: 32
Thank you,
Now, I know where to start.
I will try the Struts Autocompleter first and If I get the time JQuery tags.

MJ

Sunil Moharana
Greenhorn

Joined: Oct 15, 2010
Posts: 1
Hi, I am sunil,completely new to coderanch and also new to java.I am working on a knowledge base project.In this project a search engine is implemented and the technologies are struts2,hibernate,jsp etc.... I want to implement autocomplete.But i am not able to do that.Please some one give tne complete steps how i 'll implement ?There is a problem table,in which problem title field is there.I want to search on problem title and autocomplete also.Please help ....
Johannes Geppert
Ranch Hand

Joined: Jan 12, 2010
Posts: 67
Hi Sunil,

you can try this:

http://code.google.com/p/struts2-jquery/wiki/AutocompleterTag

Maybe this helps you out.


My Java and Webprogramming Blog
Alberto Zolezzi
Greenhorn

Joined: Dec 13, 2010
Posts: 9
this is the article i'm trying to follow:
tutorial-create-autocomplete-feature-with-java-jsp-jquery



This is how my hibernate code look like:

List<Pazienti> taList = sessionh.createQuery("from Pazienti").list();
Iterator<Pazienti> itr = taList.iterator();
while (itr.hasNext()) {
Pazienti ta = itr.next();
while (itr.hasNext()) {
String surn = ta.getPaz_cognome();
PrintStream out = null;
out.println(surn);
}
}


Unfortunately I'm getting something like this:
net.lupo.contact.model.Pazienti@9c939

how do I have to iterate on the list to retrieve a list of username like this ?

Andrew
Alan
Antony
mark


A man who works with his hands is a laborer; a man who works with his hands and his brain is a craftsman; but a man who works with his hands and his brain and his heart is an artist. Louis Nizer.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Autocomplete search with Struts and Hibernate