aspose file tools*
The moose likes Struts and the fly likes Struts2 - Json - Autocomplete problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 - Json - Autocomplete problem" Watch "Struts2 - Json - Autocomplete problem" New topic

Struts2 - Json - Autocomplete problem

anil kumar mullapudi

Joined: Oct 25, 2011
Posts: 8
Autocomplete is not working for me, my control goes upto Action class, After that my autocomplete is not getting data from my Action class to jsp page.

jsp page

<s:url id="searchURL" action="searchActionJSON" />

<sx:autocompleter size="24" label="User"
name="strUser_Name" href="%{searchURL}" autoComplete="true"
loadOnTextChange="true" loadMinimumCount="1"></sx:autocompleter>


<action name="searchActionJSON" class="manageUserAction" method="searchActionJSON">
<result type="json">
<param name="root">json</param>

action class

public String searchActionJSON() {
System.out.println("---------search val-------->" + objUser.getStrUser_Name());

json = new HashMap<String, String>();

if (objUser.getStrUser_Name() != null && objUser.getStrUser_Name().length() > 0) {

System.out.println("********inside if**********"); // control comes upto here
json.put("1", "apple");
json.put("2", "banana");
json.put("3", "orange");
return "success";

the above json variable has setter and getters

when i type a letter in my autocomplete combo box , that letter comes to action class.But after that data is not coming to my jsp.
Please help me, how to find the root cause.

I agree. Here's the link:
subject: Struts2 - Json - Autocomplete problem
Similar Threads
Struts 2 + Json - Autocompleate example not finding Json Action.
Struts 2 autocompleter not populating from database
Struts2 + JSON : Getting Class Not Found Error
Handling Ajax response in struts2
Struts2-json plugin not serializing action class to json