struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tony Zhang <>
Subject [S2]question about S2+YUI+JSON.
Date Wed, 23 Jan 2008 00:55:28 GMT

I want to write a demo using S2+YUI+JSON. And I got an issue about async call
struts2 action.

In my jsp file, there is call struts action. I want to submit same data to
sever and the server return the json result. But I fount the json plugin
can't populate the parameter form request to action. 

Javascript sumbit some data,

var sUrl = "dragDropPost.action";
YAHOO.util.Connect.asyncRequest('POST', sUrl, callback,
"list1="+parseList(ul1, "List 1")+"&list2="+parseList(ul2, "List 2"));


       <action name="dragDropReturn" class="test.DragDropAction"
	       	<interceptor-ref name="json"/>
             <result />


public class DragDropAction  extends ActionSupport {   

	private String list1;
	private String list2;
             private Map map = new HashMap();

	public String execute()
                map.put("Content", "Hello Paciolan");
                return  Action.SUCCESS;

	public String getList1() {
		return list1;

	public void setList1(String list1) {
		this.list1 = list1;

	public String getList2() {
		return list2;

	public void setList2(String list2) {
		this.list2 = list2;
    public Map getMap()
        return map;

    public void setMap(Map value)
        map = value;

I found the list1 and list2 were not populated when I submit the data.

What should I do?
View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message