Exemplo n.º 1
0
  public int doAfterBody() throws JspException {
    BodyContent body = getBodyContent();
    String content = body.getString().trim();
    try {
      if ((this.method == null) || (this.method.equals(""))) {
        throw new RuntimeException("Tree既未指定Method");
      }

      TreeAction tree = new TreeAction();
      tree.setTagBody(content);
      tree.setMethod(this.method);

      HtmlP p = new HtmlP();
      p.parseHtml(content);
      tree.setTemplate(p);

      tree.setID(this.id);
      tree.setLazy(this.lazy);
      tree.setExpand(this.expand);
      if (this.level <= 0) {
        this.level = 999;
      }
      tree.setLevel(this.level);
      tree.setStyle(this.style);

      HttpServletRequest request = (HttpServletRequest) this.pageContext.getRequest();
      HttpServletResponse response = (HttpServletResponse) this.pageContext.getResponse();

      Current.init(request, response, this.method);
      tree.setParams(Current.getRequest());
      Current.invokeMethod(this.method, new Object[] {tree});

      getPreviousOut().write(tree.getHtml());
    } catch (Exception e1) {
      e1.printStackTrace();
    }
    return 6;
  }