Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Autocomplete search with Struts and Hibernate

 
M Marin
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 213
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My personal favourites are the Struts Autocompleter and the AjaxTags Autocomplete.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(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
Posts: 213
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sunil,

you can try this:

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

Maybe this helps you out.
 
Alberto Zolezzi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic