日期:2014-05-16 浏览次数:20367 次
package com.travelsky.tdp.pkgStock.view.test;
?
//ParentPackage注解用来定义具体action类的父XWork包或java包,一定要配置
@ParentPackage("json-default")
//命名空间
@Namespace("/ProductAjax")
//此action类所有方法返回json对象,必须配置
@Results(
??{@Result(type="json", name = "success")}
)
public class AjaxTestAction extends BaseAction
{
?private String result;
?public void setResult(String result) {
??this.result = result;
?}
?public String getResult() {
??return result;
?}
?public String ajaxTest(){
??this.result = "{'a':'ddd'}";
??//this.result = "success";
??System.out.println("OKOK");
??
??return super.SUCCESS;
?}
}