• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to implement an auto-suggest feature with Struts

 
sumita mukherjee
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to implement an auto suggest feaure, so that when user types a word in a text box, pressing the "spacebar" takes the word to the backend, where we have a logic to bring suggestion sentences.

I guess I have to put some kind of action mapping when user presses spacebar so that the word is passed to my parser to fetch the suggested topics matching this. I have the matching and parser layer so that might ebe treated as a black box, taking a word and giving back an arraylist of sentences.

Later when the suggested sentences come back, I have to show it in a dropdown menu, so that user can choose a sentence/topic from the list. The development of this feature is at a very nascent stage, and I am also very new to Struts. So any guidance for the implementation would be of great help.

Thanks,
~S
 
Chris Boldon
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
AJAX, try google suggest.
 
sumita mukherjee
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I searched the net and found that there is a suggest Class that helps in creating autusuggest in struts.

http://struts.application-servers.com/suggest/index.html

Will this help me? I am not so experienced at this stage to evaluate its advantages and disadvantages. Please advise.

Regards,
~S
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's important to understand that the above class is part of Struts Layout which is a Struts add-on. In order to use it, you must download and install Struts Layout.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic