You don't need to use the json interceptor to populate the params in
the action. Struts will do that for you.

musachy

On Jan 22, 2008 7:55 PM, Tony Zhang <[EMAIL PROTECTED]> wrote:
>
> 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"));
>
>
> Struts.xml
>
>        <action name="dragDropReturn" class="test.DragDropAction"
> method="execute">
>                 <interceptor-ref name="json"/>
>              <result />
>         </action>
>
>
> Action,
>
> 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: 
> http://www.nabble.com/-S2-question-about-S2%2BYUI%2BJSON.-tp15032587p15032587.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to