/** 查询主页 */ public void query() { messageid = Long.parseLong(request.getParameter("messageid")); String page = request.getParameter("page"); // 当前页数 String rows = request.getParameter("rows"); // 每页显示行数 try { MessageComment messageComment = new MessageComment(); messageComment.setMessageid(messageid); Pager pager = messageCommentService.queryMessageCommentByPage( messageComment, Integer.valueOf(rows), Integer.valueOf(page)); super.reponseWriter(JSON.toJSONString(pager)); } catch (Exception e) { e.printStackTrace(); } }
public MessageComment getMessageComment() { String messageid = request.getParameter("messageid"); String commentctx = request.getParameter("commentctx"); Map<String, Object> session = context.getSession(); User sessionuser = (User) session.get("user"); MessageComment bbsMessage = new MessageComment(); bbsMessage.setMessageid(Long.parseLong(messageid)); bbsMessage.setCommentctx(commentctx); bbsMessage.setCommenttime(new Date()); if (sessionuser == null) { bbsMessage.setUserid(""); } else { bbsMessage.setUserid(sessionuser.getUserid()); } return bbsMessage; }