package com.showhouse.action;import java.util.List;
import java.util.Map;import com.opensymphony.xwork2.ActionSupport;
import com.showhouse.service.CommentInfoService;public class CommentsonAction extends ActionSupport{
private CommentInfoService commentinfoservice;
//分页
private int cp = 1;
private int ls = 10;
private String column = "userComment";
private String kw = "";
private List commentInfoListJson;
private int countCommentInfoJson;
public String comme(){
Map map;
try {
map = commentinfoservice.list(cp, ls, column, kw);
commentInfoListJson = (List) map.get("allComment");
countCommentInfoJson = (Integer) map.get("countComment");
} catch (Exception e) {
e.printStackTrace();
}
return SUCCESS ;
}
}function commentinfoList(){
$.getJSON("comm.action",{},callbackMessageListJson);
}
function callbackMessageListJson(data,status){
if("success" == status){
document.writeln(data);
}
输入是一个object对象,我怎么取得map中的值。
import java.util.Map;import com.opensymphony.xwork2.ActionSupport;
import com.showhouse.service.CommentInfoService;public class CommentsonAction extends ActionSupport{
private CommentInfoService commentinfoservice;
//分页
private int cp = 1;
private int ls = 10;
private String column = "userComment";
private String kw = "";
private List commentInfoListJson;
private int countCommentInfoJson;
public String comme(){
Map map;
try {
map = commentinfoservice.list(cp, ls, column, kw);
commentInfoListJson = (List) map.get("allComment");
countCommentInfoJson = (Integer) map.get("countComment");
} catch (Exception e) {
e.printStackTrace();
}
return SUCCESS ;
}
}function commentinfoList(){
$.getJSON("comm.action",{},callbackMessageListJson);
}
function callbackMessageListJson(data,status){
if("success" == status){
document.writeln(data);
}
输入是一个object对象,我怎么取得map中的值。
解决方案 »
- 接口为什么可以这样转换?
- eclipse下启动tomcat的Error提示?
- 小妹求救一关于static方法返回值的问题
- 带返回值的构造器是什么含义?
- applet放在frame里面运行良好,但是放在网页上不能正确运行
- 怎样让double型的变量显示时只输出2位小数???
- 在jbuilder 里面能够获取数据库数据,导成.exe文件后就不能获取了,怎么回事啊??
- 敢问各位大侠!!!!(数组问题),编译通过,不能执行,晕!!
- 初学者找书求助
- File类使用相对路径默认的根路径是src还是项目的根路径?
- 求助!关于QQ窗体swing的问题
- 在NIO中,如何同步接收线程池中返回的处理结果,同时做到不阻塞程序?
<action name="commentinfoListJson" class="CommentsonAction" method="commentInfoListJson">
<result name="success" type="json"></result>
</action>
</package>