public void doTag() throws JspException, IOException {
   JspContext jctxt = getJspContext();
   try {
     ZMailbox mbox = getMailbox();
     ZContact group = mbox.getContact(id);
     if (json) {
       JSONArray jsonArray = new JSONArray();
       Map<String, ZContact> members = group.getMembers();
       for (ZContact contact : members.values()) {
         Map<String, String> attrs = contact.getAttrs();
         String addr = attrs.get("email");
         if (addr != null) {
           jsonArray.put(addr);
         }
       }
       JSONObject top = new JSONObject();
       top.put("Result", jsonArray);
       top.write(jctxt.getOut());
     }
   } catch (JSONException e) {
     throw new JspTagException(e);
   } catch (ServiceException e) {
     throw new JspTagException(e);
   }
 }
Beispiel #2
0
  public void doTag() throws JspException, java.io.IOException {
    PageContext _jspx_page_context = (PageContext) jspContext;
    HttpServletRequest request = (HttpServletRequest) _jspx_page_context.getRequest();
    HttpServletResponse response = (HttpServletResponse) _jspx_page_context.getResponse();
    HttpSession session = _jspx_page_context.getSession();
    ServletContext application = _jspx_page_context.getServletContext();
    ServletConfig config = _jspx_page_context.getServletConfig();
    JspWriter out = jspContext.getOut();
    _jspInit(config);
    jspContext.getELContext().putContext(JspContext.class, jspContext);
    if (getRender() != null) _jspx_page_context.setAttribute("render", getRender());

    try {
      if (_jspx_meth_c_005fif_005f0(_jspx_page_context)) return;
    } catch (Throwable t) {
      if (t instanceof SkipPageException) throw (SkipPageException) t;
      if (t instanceof java.io.IOException) throw (java.io.IOException) t;
      if (t instanceof IllegalStateException) throw (IllegalStateException) t;
      if (t instanceof JspException) throw (JspException) t;
      throw new JspException(t);
    } finally {
      jspContext.getELContext().putContext(JspContext.class, super.getJspContext());
      ((org.apache.jasper.runtime.JspContextWrapper) jspContext).syncEndTagFile();
      _jspDestroy();
    }
  }
  public void doTag() throws JspException, IOException {

    JspContext ctx = getJspContext();
    JspWriter out = ctx.getOut();

    int sum = num1 + num2;
    ctx.setAttribute("sum", Integer.toString(sum));

    out.println(num1 + " + " + num2 + " = " + sum);
  }
  public void doTag() throws JspException, IOException {
    JspContext jctxt = getJspContext();
    try {
      ZMailbox mbox = mMailbox != null ? mMailbox.getMailbox() : getMailbox();

      List<ZAppointmentHit> appts;
      if (mFolderId == null || mFolderId.length() == 0) {
        // if non are checked, return no appointments (to match behavior of ajax client
        appts = new ArrayList<ZAppointmentHit>();
      } else if (mFolderId.indexOf(',') == -1) {
        List<ZApptSummaryResult> result =
            mbox.getApptSummaries(
                mQuery,
                mStart,
                mEnd,
                new String[] {mFolderId},
                mTimeZone,
                ZSearchParams.TYPE_APPOINTMENT);
        // appts = mbox.getApptSummaries(mStart, mEnd, mFolderId);
        if (result.size() != 1) {
          appts = new ArrayList<ZAppointmentHit>();
          for (ZApptSummaryResult r : result) {
            appts.addAll(r.getAppointments());
          }
        } else {
          ZApptSummaryResult asr = result.get(0);
          appts = asr.getAppointments();
        }
      } else {
        appts = new ArrayList<ZAppointmentHit>();
        List<ZApptSummaryResult> result =
            mbox.getApptSummaries(
                mQuery,
                mStart,
                mEnd,
                mFolderId.split(","),
                mTimeZone,
                ZSearchParams.TYPE_APPOINTMENT);
        for (ZApptSummaryResult sum : result) {
          appts.addAll(sum.getAppointments());
        }
      }
      jctxt.setAttribute(mVar, new ZApptSummariesBean(appts), PageContext.PAGE_SCOPE);

    } catch (ServiceException e) {
      if (mVarException != null) {
        jctxt.setAttribute(mVarException, e, PageContext.PAGE_SCOPE);
        jctxt.setAttribute(
            mVar, new ZApptSummariesBean(new ArrayList<ZAppointmentHit>()), PageContext.PAGE_SCOPE);
      } else {
        throw new JspTagException(e);
      }
    }
  }
 @Override
 public void doTag() throws JspException, IOException {
   JspContext ctx = getJspContext();
   JspWriter w = ctx.getOut();
   w.println("enter TestSimpleTag " + name);
   JspFragment f = getJspBody();
   for (int i = 0; i < bodyLoopCount; ++i) {
     w.println("invoking body i=" + i);
     f.invoke(w);
   }
   w.println("exit TestSimpleTag " + name);
 }
  public void doTag() throws JspException, IOException {
    JspContext jspContext = getJspContext();

    treeTagSupport.doStartTag();

    // Evaluate any nested tags.
    JspFragment jspBody = getJspBody();
    if (jspBody != null) {
      jspBody.invoke(jspContext.getOut());
    }

    treeTagSupport.doEndTag((PageContext) jspContext);
  }
  private void handleFolder(
      ZFolder folder, JspFragment body, JspContext jctxt, boolean skip, boolean skipsystem)
      throws ServiceException, JspException, IOException {
    if (folder == null) return;

    if (skipsystem && folder.isSystemFolder() && !folder.getId().equals(ZFolder.ID_USER_ROOT))
      return;

    if (mSkipTopSearch
        && (folder instanceof ZSearchFolder)
        && folder.getParentId().equals(ZFolder.ID_USER_ROOT)) return;

    if (mSkipTrash && folder.getId().equals(ZFolder.ID_TRASH)) return;

    if (!skip) {
      jctxt.setAttribute(mVar, new ZFolderBean(folder));
      body.invoke(null);
    }

    if (mExpanded != null && !folder.getSubFolders().isEmpty()) {
      String state = (String) mExpanded.get(folder.getId());
      if (state != null && state.equals("collapse")) return;
    }

    List<ZFolder> subfolders = folder.getSubFolders();
    Collections.sort(subfolders);
    for (ZFolder subfolder : subfolders) {
      if (subfolder != null) handleFolder(subfolder, body, jctxt, false, skipsystem);
    }
  }
Beispiel #8
0
  public void doTag() throws JspException, java.io.IOException {
    PageContext _jspx_page_context = (PageContext) jspContext;
    HttpServletRequest request = (HttpServletRequest) _jspx_page_context.getRequest();
    HttpServletResponse response = (HttpServletResponse) _jspx_page_context.getResponse();
    HttpSession session = _jspx_page_context.getSession();
    ServletContext application = _jspx_page_context.getServletContext();
    ServletConfig config = _jspx_page_context.getServletConfig();
    JspWriter out = jspContext.getOut();
    _jspInit(config);
    jspContext.getELContext().putContext(JspContext.class, jspContext);

    try {
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("<div class=\"nav dropdown pull-right\">\n");
      out.write("    <a class=\"dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\">\n");
      out.write("    \t排序: ");
      out.write(
          (java.lang.String)
              org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(
                  "${sortTypes[param.sortType]}",
                  java.lang.String.class,
                  (PageContext) this.getJspContext(),
                  null,
                  false));
      out.write(" <b class=\"caret\"></b>\n");
      out.write("    </a>\n");
      out.write("\t<ul class=\"dropdown-menu\" >\n");
      out.write("\t   \t");
      if (_jspx_meth_c_005fforEach_005f0(_jspx_page_context)) return;
      out.write("\n");
      out.write("\t</ul>\n");
      out.write("</div>");
    } catch (Throwable t) {
      if (t instanceof SkipPageException) throw (SkipPageException) t;
      if (t instanceof java.io.IOException) throw (java.io.IOException) t;
      if (t instanceof IllegalStateException) throw (IllegalStateException) t;
      if (t instanceof JspException) throw (JspException) t;
      throw new JspException(t);
    } finally {
      jspContext.getELContext().putContext(JspContext.class, super.getJspContext());
      ((org.apache.jasper.runtime.JspContextWrapper) jspContext).syncEndTagFile();
      _jspDestroy();
    }
  }
 public void setDate(java.lang.Boolean date) {
   this.date = date;
   jspContext.setAttribute("date", date);
 }
Beispiel #10
0
 public void setRender(java.lang.Boolean render) {
   this.render = render;
   jspContext.setAttribute("render", render);
 }
Beispiel #11
0
 public void setProperty(java.lang.String property) {
   this.property = property;
   jspContext.setAttribute("property", property);
 }
 public void setObject(java.lang.Object object) {
   this.object = object;
   jspContext.setAttribute("object", object);
 }
 public void setId(java.lang.String id) {
   this.id = id;
   jspContext.setAttribute("id", id);
 }
 public void setZ(java.lang.String z) {
   this.z = z;
   jspContext.setAttribute("z", z);
 }
 public void setDateTimePattern(java.lang.String dateTimePattern) {
   this.dateTimePattern = dateTimePattern;
   jspContext.setAttribute("dateTimePattern", dateTimePattern);
 }
 public void setCalendar(java.lang.Boolean calendar) {
   this.calendar = calendar;
   jspContext.setAttribute("calendar", calendar);
 }
 public void setLabel(java.lang.String label) {
   this.label = label;
   jspContext.setAttribute("label", label);
 }
 public void setField(java.lang.String field) {
   this.field = field;
   jspContext.setAttribute("field", field);
 }
Beispiel #19
0
 public void setMaxLength(java.lang.Integer maxLength) {
   this.maxLength = maxLength;
   jspContext.setAttribute("maxLength", maxLength);
 }
  public void doTag() throws javax.servlet.jsp.JspException, java.io.IOException {
    javax.servlet.jsp.PageContext _jspx_page_context = (javax.servlet.jsp.PageContext) jspContext;
    javax.servlet.http.HttpServletRequest request =
        (javax.servlet.http.HttpServletRequest) _jspx_page_context.getRequest();
    javax.servlet.http.HttpServletResponse response =
        (javax.servlet.http.HttpServletResponse) _jspx_page_context.getResponse();
    javax.servlet.http.HttpSession session = _jspx_page_context.getSession();
    javax.servlet.ServletContext application = _jspx_page_context.getServletContext();
    javax.servlet.ServletConfig config = _jspx_page_context.getServletConfig();
    javax.servlet.jsp.JspWriter out = jspContext.getOut();
    _jspInit(config);
    jspContext.getELContext().putContext(javax.servlet.jsp.JspContext.class, jspContext);

    try {
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("<!DOCTYPE html>\r\n");
      out.write("<html>\r\n");
      out.write("<head>\r\n");
      out.write("    <title>SaveTheMeeting</title>\r\n");
      out.write("    <link rel=\"icon\" href=\"");
      if (_jspx_meth_c_005furl_005f0(_jspx_page_context)) return;
      out.write("\"/>\r\n");
      out.write("    <link rel=\"stylesheet\" href=\"");
      if (_jspx_meth_c_005furl_005f1(_jspx_page_context)) return;
      out.write("\"/>\r\n");
      out.write("    <link rel=\"stylesheet\" href=\"");
      if (_jspx_meth_c_005furl_005f2(_jspx_page_context)) return;
      out.write("\"/>\r\n");
      out.write("    <link rel=\"stylesheet\" href=\"");
      if (_jspx_meth_c_005furl_005f3(_jspx_page_context)) return;
      out.write("\"/>\r\n");
      out.write("    <link rel=\"stylesheet\" href=\"");
      if (_jspx_meth_c_005furl_005f4(_jspx_page_context)) return;
      out.write("\"/>\r\n");
      out.write("    <link rel=\"stylesheet\" href=\"");
      if (_jspx_meth_c_005furl_005f5(_jspx_page_context)) return;
      out.write("\"/>\r\n");
      out.write("\r\n");
      out.write("    ");
      out.write("\r\n");
      out.write("    <script src=\"");
      if (_jspx_meth_c_005furl_005f6(_jspx_page_context)) return;
      out.write("\"></script>\r\n");
      out.write("    <script src=\"");
      if (_jspx_meth_c_005furl_005f7(_jspx_page_context)) return;
      out.write("\"></script>\r\n");
      out.write("    <script src=\"");
      if (_jspx_meth_c_005furl_005f8(_jspx_page_context)) return;
      out.write("\"></script>\r\n");
      out.write("\r\n");
      out.write("    <script src=\"");
      if (_jspx_meth_c_005furl_005f9(_jspx_page_context)) return;
      out.write("\"></script>\r\n");
      out.write("</head>\r\n");
      out.write("<body>\r\n");
      ((org.apache.jasper.runtime.JspContextWrapper) this.jspContext).syncBeforeInvoke();
      _jspx_sout = null;
      if (getJspBody() != null) getJspBody().invoke(_jspx_sout);
      jspContext.getELContext().putContext(javax.servlet.jsp.JspContext.class, getJspContext());
      out.write("\r\n");
      out.write("</body>\r\n");
      out.write("</html>\r\n");
    } catch (java.lang.Throwable t) {
      if (t instanceof javax.servlet.jsp.SkipPageException)
        throw (javax.servlet.jsp.SkipPageException) t;
      if (t instanceof java.io.IOException) throw (java.io.IOException) t;
      if (t instanceof java.lang.IllegalStateException) throw (java.lang.IllegalStateException) t;
      if (t instanceof javax.servlet.jsp.JspException) throw (javax.servlet.jsp.JspException) t;
      throw new javax.servlet.jsp.JspException(t);
    } finally {
      jspContext
          .getELContext()
          .putContext(javax.servlet.jsp.JspContext.class, super.getJspContext());
      ((org.apache.jasper.runtime.JspContextWrapper) jspContext).syncEndTagFile();
      _jspDestroy();
    }
  }