コード例 #1
0
ファイル: Vlado2Portlet.java プロジェクト: e3evans/WorkSpaces
  /** Serve up the custom <code>config</code> mode. */
  protected void doCustomConfigure(RenderRequest request, RenderResponse response)
      throws PortletException, IOException {
    // Set the MIME type for the render response
    response.setContentType(request.getResponseContentType());

    // Invoke the JSP to render
    PortletRequestDispatcher rd =
        getPortletContext().getRequestDispatcher(getJspFilePath(request, CONFIG_JSP));
    rd.include(request, response);
  }
コード例 #2
0
  /**
   * Serve up the <code>view</code> mode.
   *
   * @see javax.portlet.GenericPortlet#doView(javax.portlet.RenderRequest,
   *     javax.portlet.RenderResponse)
   */
  public void doView(RenderRequest request, RenderResponse response)
      throws PortletException, IOException {
    // Set the MIME type for the render response
    response.setContentType(request.getResponseContentType());

    // Invoke the JSP to render
    PortletRequestDispatcher rd =
        getPortletContext().getRequestDispatcher(getJspFilePath(request, VIEW_JSP));
    rd.include(request, response);
  }
コード例 #3
0
ファイル: Vlado2Portlet.java プロジェクト: e3evans/WorkSpaces
  /**
   * Serve up the <code>edit</code> mode.
   *
   * @see javax.portlet.GenericPortlet#doEdit(javax.portlet.RenderRequest,
   *     javax.portlet.RenderResponse)
   */
  public void doEdit(RenderRequest request, RenderResponse response)
      throws PortletException, IOException {
    // Set the MIME type for the render response
    response.setContentType(request.getResponseContentType());

    // Check if portlet session exists
    Vlado2PortletSessionBean sessionBean = getSessionBean(request);
    if (sessionBean == null) {
      response.getWriter().println("<b>NO PORTLET SESSION YET</b>");
      return;
    }

    // Invoke the JSP to render
    PortletRequestDispatcher rd =
        getPortletContext().getRequestDispatcher(getJspFilePath(request, EDIT_JSP));
    rd.include(request, response);
  }
コード例 #4
0
ファイル: Vlado2Portlet.java プロジェクト: e3evans/WorkSpaces
  /**
   * Serve up the <code>view</code> mode.
   *
   * @see javax.portlet.GenericPortlet#doView(javax.portlet.RenderRequest,
   *     javax.portlet.RenderResponse)
   */
  public void doView(RenderRequest request, RenderResponse response)
      throws PortletException, IOException {
    // Set the MIME type for the render response
    response.setContentType(request.getResponseContentType());
    HttpServletRequest req = (HttpServletRequest) request;
    ServletRequest sreq = (ServletRequest) request;
    System.out.println("TEST--->" + req.getQueryString());
    System.out.println("TEST2--->" + sreq.getParameter("param"));
    // Check if portlet session exists
    Vlado2PortletSessionBean sessionBean = getSessionBean(request);
    if (sessionBean == null) {
      response.getWriter().println("<b>NO PORTLET SESSION YET</b>");
      return;
    }

    // Invoke the JSP to render
    PortletRequestDispatcher rd =
        getPortletContext().getRequestDispatcher(getJspFilePath(request, VIEW_JSP));
    rd.include(request, response);
  }
  @Override
  public void processAction(ActionRequest portletReq, ActionResponse portletResp)
      throws PortletException, IOException {
    LOGGER.entering(LOG_CLASS, "main portlet processAction entry");

    portletResp.setRenderParameters(portletReq.getParameterMap());
    long tid = Thread.currentThread().getId();
    portletReq.setAttribute(THREADID_ATTR, tid);

    StringWriter writer = new StringWriter();

    // Now do the actual dispatch
    String target =
        JSP_PREFIX
            + "DispatcherReqRespTests3_SPEC2_19_IncludeJSPActionResponse"
            + JSP_SUFFIX
            + "?"
            + QUERY_STRING;
    PortletRequestDispatcher rd = portletConfig.getPortletContext().getRequestDispatcher(target);
    rd.include(portletReq, portletResp);
  }