• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Autocomplete search with Struts and Hibernate

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 213
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My personal favourites are the Struts Autocompleter and the AjaxTags Autocomplete.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ....
 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Yeast devil! Back to the oven that baked you! And take this tiny ad too:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic