日期:2014-05-16 浏览次数:20629 次
public String result;
public String getResult() {
return result;
}
public void setResult(String result) {
this.result = result;
}
public void cut() throws IOException{
Map map = new HashMap();
map.put("filename", this.getFileName());
map.put("zym","yimeng");
setResult(JSONObject.fromObject(map).toString());
}
<package name="projectUI" extends="json-default">
<action name="cut" class="dynasoft.web.project.action.UpLoad" method="cut">
<result type="json">
<param name="root">result</param>
</result>
</action>
</package>
function cut(){
var url="cut.action?date=" +new Date();
var params="x="+$("#x").val()+"&y="+$("#y").val()+"&width="+$("#width").val()+"&height="+$("#height").val()+"&imgw="+$("#imgw").val()+"&imgh="+$("#imgh").val()+"&fileName="+$("#fileName").val()+"";
$.ajax({
type:"POST",
url:url,
async:false,
dataType:'json',
data:params,
success:function(data){
alert(data);
},
});
}