示例#1
0
  @Override
  public int doStartTag() throws JspException {
    if (model.getTotalPage() < 2) return TagSupport.SKIP_BODY;

    this.pageUrl = genPageUrl();

    return TagSupport.EVAL_BODY_INCLUDE;
  }
示例#2
0
  private String genPageUrl() {
    String result = pageUrl;
    Map<String, Object> query = model.getQuery();
    if (query != null && !query.isEmpty()) {
      result += "?";
      for (Map.Entry<String, Object> entry : query.entrySet()) {
        result += entry.getKey() + "=" + entry.getValue() + "&";
      }
      result += "page=";
    } else {
      result += "?page=";
    }

    return result;
  }