@Override
  public String list() {
    try {
      List<PropertyFilter> filters = PropertyFilter.buildFromHttpRequest(Struts2Utils.getRequest());
      PropertyFilterUtils.handleFilter(page, AreaInfo.class, filters);

      page = manager.searchProperty(page, filters);
    } catch (Exception e) {
      logger.error("获取地区信息列表: ", e);
    }
    return JSON;
  }
示例#2
0
  public static Page RiaToPage(Page page) {

    // 获取dwz排序
    String orderField = Struts2Utils.getRequest().getParameter("orderField");
    String orderDirection = Struts2Utils.getRequest().getParameter("orderDirection");
    if ((orderField != null) && (orderDirection != null)) {
      page.setOrderBy(orderField);
      page.setOrder(orderDirection);
      // System.out.println("数年:"+ orderField + ":" + orderDirection);
    }

    // 分页数
    String numPerPage = Struts2Utils.getRequest().getParameter("numPerPage");
    if (numPerPage != null) {
      page.setPageSize(Integer.valueOf(numPerPage));
    }

    // 第几页
    String pageNum = Struts2Utils.getRequest().getParameter("pageNum");
    if (pageNum != null) {
      page.setPageNo(Integer.valueOf(pageNum));
    }
    return page;
  }
示例#3
0
 @Override
 public String execute() throws Exception {
   HttpServletRequest request = Struts2Utils.getRequest();
   entity = userManager.get((Long) request.getSession().getAttribute("userid"));
   return SUCCESS;
 }