File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 Badass: Making Users Awesome this week in the Game Development forum!
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
 
Don't get me started about those stupid light bulbs.
 
subject: Struts2 - Json - Autocomplete problem