struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Ruggles <a.rugg...@gmail.com>
Subject Re: $.getJSON(ur,params,function(data)(){}‏
Date Tue, 31 Mar 2009 15:07:00 GMT

I'm not that familiar with the JSON result type, but it looks like data would
contain the property methods of your SortTierVO bean.  An easy way to see
whats going on is to browse to SortTiersAction and see what spits out of the
browser.  It should look something like this:

{
  method1: 'value',
  method2: true,
  ...
}

Firefox with the firebug plugin is the developers best tool when debugging
JavaScript.



Junhua gao wrote:
> 
> 
> Hello,
> 
>      I am using struts2 and Jquery now.
> 
>      And who can please tell me how to access the sorttiervo from the
> 'data'    $.getJSON('SortTiersAction',params,function(data)(){} 
> 
>       
> 
>      data.sorttiervo? or other ways?
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>   public class SortTiersAction extends BaseActionS2 implements ModelDriven
> {
>        SortTierService  sorttierservice = new SortTierService();
>        private SortTierVO sorttiervo  = new SortTierVO();
> 
>        public void setModel(SortTierVO sorttiervo) {
>                  this.sorttiervo = sorttiervo;
>         }
> 
>          public Object getModel() {
>             return this.sorttiervo;
>        }
> 
>       public String execute() throws DefaultException {
> 
> 
> 
>       //do someting here;
> 
>  
> 
>       }
> 
> 
> 
> 
> 
> in struts.xml file
> 
> 
> 
> <action name="SortTierQueryAction"
> class="com.qic.system.action.SortTiersAction">
>    <result type="json">
>        true
>    </result>
> </action> 
> 
> 
> 
>       ___________________________________________________________ 
>   好玩贺卡等你发,邮箱贺卡全新上线! 
> http://card.mail.cn.yahoo.com/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/%24.getJSON%28ur%2Cparams%2Cfunction%28data%29%28%29%7B%7D%E2%80%8F-tp22802378p22804985.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message