示例#1
0
  public void save() {
    boolean flag = false;
    BBSMessage bbsMessage = getBBSMessage();

    try {
      bbsMessage.setScannum(Long.parseLong("0"));
      bbsMessage.setIsessence(0);
      bbsMessageService.saveEntity(bbsMessage);
      flag = true;
      super.reponseWriter(JSON.toJSONString(flag));
    } catch (NumberFormatException e) {
      e.printStackTrace();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
示例#2
0
 /**
  * 标记精华贴
  *
  * @throws IOException
  */
 public void essence() throws IOException {
   response.setHeader("Content-type", "text/html;chartset=utf8");
   response.setCharacterEncoding("utf8");
   PrintWriter out = response.getWriter();
   String id = request.getParameter("id");
   try {
     BBSMessage bbsMessage = bbsMessageService.findEntityById(Long.valueOf(id), BBSMessage.class);
     bbsMessage.setIsessence(1);
     bbsMessageService.saveEntity(bbsMessage);
     out.print("标记成功");
   } catch (NumberFormatException e) {
     e.printStackTrace();
     out.print("标记失败");
   } catch (Exception e) {
     e.printStackTrace();
     out.print("标记失败");
   } finally {
     out.flush();
     out.close();
   }
 }
示例#3
0
  public String addMsg() {
    boolean flag = false;
    BBSMessage bbsMessage = getBBSMessage();

    try {
      bbsMessage.setScannum(Long.parseLong("0"));
      bbsMessage.setIsessence(0);
      bbsMessageService.saveEntity(bbsMessage);
      flag = true;
    } catch (NumberFormatException e) {
      e.printStackTrace();
    } catch (Exception e) {
      e.printStackTrace();
    }
    if (flag) {
      return "bbs_index";
    } else {
      errmsg = "发帖失败";
      return "bbs_sent";
    }
  }