예제 #1
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();
    }
  }
예제 #2
0
파일: WebBean.java 프로젝트: Redor/Openfire
 public void init(PageContext pageContext) {
   this.request = (HttpServletRequest) pageContext.getRequest();
   this.response = (HttpServletResponse) pageContext.getResponse();
   this.session = pageContext.getSession();
   this.application = pageContext.getServletContext();
   this.out = pageContext.getOut();
 }
  /**
   * Performs the export.
   *
   * @param context the page context
   * @param i18n the internationalization package to use.
   */
  public void doExport(PageContext context, I18n i18n) {

    String filterId = new TopTotalEnqueuesFilter().getFilterId();

    RunningJobsInfoDAO dao = RunningJobsInfoDAO.getInstance();
    InMemoryFrontierReport report = dao.getFrontierReport(jobId, filterId);

    HttpServletResponse resp = (HttpServletResponse) context.getResponse();
    resp.setHeader("Content-Type", "text/plain");
    resp.setHeader(
        "Content-Disposition",
        "Attachment; filename=" + filterId + "-" + report.getJobName() + ".csv");

    PrintWriter pw;
    try {
      pw = new PrintWriter(resp.getOutputStream());
    } catch (IOException e) {
      HTMLUtils.forwardWithErrorMessage(
          context, i18n, e, "errorMsg;running.job.details.frontier.exportAsCsv");
      throw new ForwardedToErrorPage("Error in frontier report CSV export", e);
    }

    FrontierReportCsvExport.outputAsCsv(report, pw, ";");
    pw.close();
  }
 private boolean _jspx_meth_c_if_1(javax.servlet.jsp.PageContext pageContext) throws Throwable {
   JspWriter out = pageContext.getOut();
   HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
   HttpServletResponse response = (HttpServletResponse) pageContext.getResponse();
   /* ----  c:if ---- */
   org.apache.taglibs.standard.tag.el.core.IfTag _jspx_th_c_if_1 =
       (org.apache.taglibs.standard.tag.el.core.IfTag)
           _jspx_tagPool_c_if_test.get(org.apache.taglibs.standard.tag.el.core.IfTag.class);
   _jspx_th_c_if_1.setPageContext(pageContext);
   _jspx_th_c_if_1.setParent(null);
   _jspx_th_c_if_1.setTest("${param.orgAdminPopup}");
   int _jspx_eval_c_if_1 = _jspx_th_c_if_1.doStartTag();
   if (_jspx_eval_c_if_1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
     do {
       out.write("\n    ");
       JspRuntimeLibrary.include(
           request,
           response,
           "/includes/orgAdmin_header.jsp"
               + "?"
               + "help="
               + "monitoringadmin%2Fusers%2FWTHelp_User.html",
           out,
           false);
       out.write("\n");
       int evalDoAfterBody = _jspx_th_c_if_1.doAfterBody();
       if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break;
     } while (true);
   }
   if (_jspx_th_c_if_1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) return true;
   _jspx_tagPool_c_if_test.reuse(_jspx_th_c_if_1);
   return false;
 }
예제 #5
0
  public final void Load(PageContext pagecontext) throws ServletException, IOException {
    m_pagecontext = pagecontext;
    m_application = pagecontext.getServletContext();
    m_request = (HttpServletRequest) pagecontext.getRequest();
    m_response = (HttpServletResponse) pagecontext.getResponse();
    m_session = (HttpSession) pagecontext.getSession();
    out = m_response.getWriter();

    InitUpload();
  }
 /**
  * Initialize this context with the given page context, using the given model attributes for
  * Errors retrieval.
  *
  * @param pageContext current JSP page context
  * @param model the model attributes for the current view (can be {@code null}, using the request
  *     attributes for Errors retrieval)
  */
 protected void initContext(PageContext pageContext, Map<String, Object> model) {
   if (!(pageContext.getRequest() instanceof HttpServletRequest)) {
     throw new IllegalArgumentException("RequestContext only supports HTTP requests");
   }
   this.pageContext = pageContext;
   initContext(
       (HttpServletRequest) pageContext.getRequest(),
       (HttpServletResponse) pageContext.getResponse(),
       pageContext.getServletContext(),
       model);
 }
예제 #7
0
  private static TemplateModel createModel(PageContext pageContext, Map<String, Object> map) {
    ObjectWrapper wrapper = ObjectWrapper.DEFAULT_WRAPPER;
    HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
    HttpServletResponse response = (HttpServletResponse) pageContext.getResponse();
    HttpServlet servlete =
        new ProxyServlet(pageContext.getServletConfig(), pageContext.getServletContext());
    ServletContextHashModel servletContextModel = new ServletContextHashModel(servlete, wrapper);
    ServletActionContext.getServletContext()
        .setAttribute(ATTR_APPLICATION_MODEL, servletContextModel);
    TaglibFactory taglibs = new TaglibFactory(ServletActionContext.getServletContext());
    ServletActionContext.getServletContext().setAttribute(ATTR_JSP_TAGLIBS_MODEL, taglibs);
    AllHttpScopesHashModel params =
        new AllHttpScopesHashModel(wrapper, pageContext.getServletContext(), request);
    params.putUnlistedModel(KEY_APPLICATION, servletContextModel);
    params.putUnlistedModel(KEY_APPLICATION_PRIVATE, servletContextModel);
    params.putUnlistedModel(
        KEY_JSP_TAGLIBS,
        (TemplateModel)
            ServletActionContext.getServletContext().getAttribute(ATTR_JSP_TAGLIBS_MODEL));

    // Create hash model wrapper for session
    HttpSessionHashModel sessionModel;
    HttpSession session = request.getSession(false);
    sessionModel = (HttpSessionHashModel) session.getAttribute(ATTR_SESSION_MODEL);
    if (sessionModel == null) {
      sessionModel = new HttpSessionHashModel(session, wrapper);
      session.setAttribute(ATTR_SESSION_MODEL, sessionModel);
    }
    params.putUnlistedModel(KEY_SESSION, sessionModel);

    // Create hash model wrapper for request
    HttpRequestHashModel requestModel =
        (HttpRequestHashModel) request.getAttribute(ATTR_REQUEST_MODEL);
    if (requestModel == null || requestModel.getRequest() != request) {
      requestModel = new HttpRequestHashModel(request, response, wrapper);
      request.setAttribute(ATTR_REQUEST_MODEL, requestModel);
      request.setAttribute(
          ATTR_REQUEST_PARAMETERS_MODEL, new HttpRequestParametersHashModel(request));
    }
    params.putUnlistedModel(KEY_REQUEST, requestModel);
    params.putUnlistedModel(KEY_INCLUDE, new IncludePage(request, response));
    params.putUnlistedModel(KEY_REQUEST_PRIVATE, requestModel);

    // Create hash model wrapper for request parameters
    HttpRequestParametersHashModel requestParametersModel =
        (HttpRequestParametersHashModel) request.getAttribute(ATTR_REQUEST_PARAMETERS_MODEL);
    params.putUnlistedModel(KEY_REQUEST_PARAMETERS, requestParametersModel);
    // 将用户数据放入model中
    params.putAll(map);
    return params;
  }
예제 #8
0
 private boolean _jspx_meth_c_005fif_005f0(javax.servlet.jsp.PageContext _jspx_page_context)
     throws java.lang.Throwable {
   javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
   javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
   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();
   //  c:if
   org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f0 =
       (org.apache.taglibs.standard.tag.rt.core.IfTag)
           _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(
               org.apache.taglibs.standard.tag.rt.core.IfTag.class);
   _jspx_th_c_005fif_005f0.setPageContext(_jspx_page_context);
   _jspx_th_c_005fif_005f0.setParent(null);
   // /WEB-INF/jsps/solutions/workflow/forms/project/proj_credit/proj_credit02.jsp(80,20) name =
   // test type = boolean reqTime = true required = true fragment = false deferredValue = false
   // expectedTypeName = null deferredMethod = false methodSignature = null
   _jspx_th_c_005fif_005f0.setTest(
       ((java.lang.Boolean)
               org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(
                   "${requestScope['proj_info.cust_type']=='法人'}",
                   java.lang.Boolean.class,
                   (javax.servlet.jsp.PageContext) _jspx_page_context,
                   null,
                   false))
           .booleanValue());
   int _jspx_eval_c_005fif_005f0 = _jspx_th_c_005fif_005f0.doStartTag();
   if (_jspx_eval_c_005fif_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
     do {
       out.write("\r\n");
       out.write("                      ");
       org.apache.jasper.runtime.JspRuntimeLibrary.include(
           request, response, "proj_credit_reportxls.jsp", out, false);
       out.write("\r\n");
       out.write("                    ");
       int evalDoAfterBody = _jspx_th_c_005fif_005f0.doAfterBody();
       if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break;
     } while (true);
   }
   if (_jspx_th_c_005fif_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
     _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f0);
     return true;
   }
   _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f0);
   return false;
 }
예제 #9
0
파일: sort_tag.java 프로젝트: NBAzx/coolweb
  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();
    }
  }
  private VelocityTaglib _getVelocityTaglib(PageContext pageContext) {
    HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();

    HttpSession session = request.getSession();

    ServletContext servletContext = session.getServletContext();

    HttpServletResponse response = (HttpServletResponse) pageContext.getResponse();

    VelocityTaglib velocityTaglib =
        new VelocityTaglibImpl(
            servletContext,
            request,
            new PipingServletResponse(response, pageContext.getOut()),
            pageContext,
            null);

    return velocityTaglib;
  }
  private void _addTaglibSupportFTL(Map<String, Object> contextObjects, PageContext pageContext)
      throws Exception {

    // FreeMarker servlet application

    final Servlet servlet = (Servlet) pageContext.getPage();

    GenericServlet genericServlet = null;

    if (servlet instanceof GenericServlet) {
      genericServlet = (GenericServlet) servlet;
    } else {
      genericServlet = new GenericServletWrapper(servlet);

      genericServlet.init(pageContext.getServletConfig());
    }

    ServletContextHashModel servletContextHashModel =
        new ServletContextHashModel(genericServlet, ObjectWrapper.DEFAULT_WRAPPER);

    contextObjects.put(
        PortletDisplayTemplateConstants.FREEMARKER_SERVLET_APPLICATION, servletContextHashModel);

    // FreeMarker servlet request

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

    HttpRequestHashModel requestHashModel =
        new HttpRequestHashModel(request, response, ObjectWrapper.DEFAULT_WRAPPER);

    contextObjects.put(
        PortletDisplayTemplateConstants.FREEMARKER_SERVLET_REQUEST, requestHashModel);

    // Taglib Liferay hash

    TemplateHashModel taglibLiferayHash =
        FreeMarkerTaglibFactoryUtil.createTaglibFactory(pageContext.getServletContext());

    contextObjects.put(PortletDisplayTemplateConstants.TAGLIB_LIFERAY_HASH, taglibLiferayHash);
  }
예제 #12
0
  @Override
  public void render(PageContext pageContext) throws JspException {
    try {
      if (UtilJ2eeCompat.doFlushOnRender(pageContext.getServletContext())) {
        pageContext.getOut().flush();
      }
      render(
          (HttpServletRequest) pageContext.getRequest(),
          (HttpServletResponse) pageContext.getResponse());
    } catch (java.io.IOException e) {
      Debug.logError(e, "Error rendering section: ", module);
      if (UtilJ2eeCompat.useNestedJspException(pageContext.getServletContext()))
        throw new JspException(e);
      else throw new JspException(e.toString());
    } catch (ServletException e) {
      Throwable throwable = e.getRootCause() != null ? e.getRootCause() : e;

      Debug.logError(throwable, "Error rendering section: ", module);
      if (UtilJ2eeCompat.useNestedJspException(pageContext.getServletContext()))
        throw new JspException(throwable);
      else throw new JspException(throwable.toString());
    }
  }
예제 #13
0
package com.jspsmart.upload;
예제 #14
0
 @Override
 public ServletResponse getResponse() {
   return parentPageContext.getResponse();
 }
예제 #15
0
  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();
    }
  }
예제 #16
0
  /**
   * Leitet den HTTP request an die JSP seite mit der gegebenen url weiter. Die url ist relativ zum
   * context root der web anwendung.
   */
  protected void forward(String url) throws ServletException, IOException {

    RequestDispatcher rd = pageContext.getRequest().getRequestDispatcher(url);
    rd.forward(pageContext.getRequest(), pageContext.getResponse());
  }
예제 #17
0
 /** Constructs a new ImportResponseWrapper. */
 public ImportResponseWrapper(PageContext pageContext) {
   super((HttpServletResponse) pageContext.getResponse());
   this.pageContext = pageContext;
 }
예제 #18
0
package project.jun.was.servlet;
예제 #19
0
 public final void initialize(PageContext pagecontext) throws ServletException {
   m_application = pagecontext.getServletContext();
   m_request = (HttpServletRequest) pagecontext.getRequest();
   m_response = (HttpServletResponse) pagecontext.getResponse();
 }
예제 #20
0
 private PortalResponse getPortalResponse() {
   PageContext pageContext = (PageContext) getJspContext();
   return (PortalResponse) pageContext.getResponse();
 }