jQuery in Action, 3rd edition
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


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 - Json - Autocomplete problem" Watch "Struts2 - Json - Autocomplete problem" New topic
Author

Struts2 - Json - Autocomplete problem

anil kumar mullapudi
Greenhorn

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>


struts.xml
---------

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


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.

Thanks,
Anil
 
Have you checked out Aspose?
 
subject: Struts2 - Json - Autocomplete problem
 
It's not a secret anymore!