This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts2 - Json - Autocomplete problem