コード例 #1
0
 /** 执行搜索 */
 public String search() {
   NoteSendQuery sendQuery = new NoteSendQuery();
   String searchType = getRequest().getParameter("searchType");
   String searchInfo = getRequest().getParameter("searchInfo").trim();
   try {
     searchInfo = java.net.URLDecoder.decode(searchInfo, "UTF-8");
   } catch (UnsupportedEncodingException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
   }
   if (null != searchInfo && !searchInfo.equals("")) {
     if ("sendid".equals(searchType)) {
       sendQuery.setSendid(searchInfo);
     }
     if ("recipient".equals(searchType)) {
       sendQuery.setRecipient(searchInfo);
     }
     if ("message".equals(searchType)) {
       sendQuery.setMessage(searchInfo);
     }
   }
   Page page = noteSendManager.findPage(sendQuery);
   savePage(page, sendQuery);
   return LIST_JSP;
 }
コード例 #2
0
  /** 执行搜索 */
  public String list() {

    // NoteSendQuery query = newQuery(NoteSendQuery.class,DEFAULT_SORT_COLUMNS);
    NoteSendQuery query = newQuery(NoteSendQuery.class, DEFAULT_SORT_COLUMNS);
    query.setCid(getMySession().getUser().getId());
    Page page = noteSendManager.findPage(query);
    savePage(page, query);
    return LIST_JSP;
  }