Java 类javax.portlet.MimeResponse 实例源码

项目:spring4-understanding    文件:AnnotationMethodHandlerExceptionResolver.java   
@Override
protected ModelAndView doResolveException(
        PortletRequest request, MimeResponse response, Object handler, Exception ex) {

    if (handler != null) {
        Method handlerMethod = findBestExceptionHandlerMethod(handler, ex);
        if (handlerMethod != null) {
            NativeWebRequest webRequest = new PortletWebRequest(request, response);
            try {
                Object[] args = resolveHandlerArguments(handlerMethod, handler, webRequest, ex);
                if (logger.isDebugEnabled()) {
                    logger.debug("Invoking request handler method: " + handlerMethod);
                }
                Object retVal = doInvokeMethod(handlerMethod, handler, args);
                return getModelAndView(retVal);
            }
            catch (Exception invocationEx) {
                logger.error("Invoking request method resulted in exception : " + handlerMethod, invocationEx);
            }
        }
    }
    return null;
}
项目:spring4-understanding    文件:SimpleMappingExceptionResolver.java   
/**
 * Actually resolve the given exception that got thrown during on handler execution,
 * returning a ModelAndView that represents a specific error page if appropriate.
 * @param request current portlet request
 * @param response current portlet response
 * @param handler the executed handler, or null if none chosen at the time of
 * the exception (for example, if multipart resolution failed)
 * @param ex the exception that got thrown during handler execution
 * @return a corresponding ModelAndView to forward to, or null for default processing
 */
@Override
protected ModelAndView doResolveException(
        PortletRequest request, MimeResponse response, Object handler, Exception ex) {

    // Log exception, both at debug log level and at warn level, if desired.
    if (logger.isDebugEnabled()) {
        logger.debug("Resolving exception from handler [" + handler + "]: " + ex);
    }
    logException(ex, request);

    // Expose ModelAndView for chosen error view.
    String viewName = determineViewName(ex, request);
    if (viewName != null) {
        return getModelAndView(viewName, ex, request);
    }
    else {
        return null;
    }
}
项目:portlet-pack    文件:ResponseFilter.java   
public void doFilter(RenderRequest request, RenderResponse response, FilterChain chain) throws IOException, PortletException
  {

    Element metaViewport = response.createElement("meta");
    metaViewport.setAttribute("name", "viewport");
    metaViewport.setAttribute("content", "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=1");
    response.addProperty(MimeResponse.MARKUP_HEAD_ELEMENT, metaViewport);

    metaViewport = response.createElement("meta");
    metaViewport.setAttribute("name", "apple-mobile-web-app-capable");
    metaViewport.setAttribute("content", "yes");
    response.addProperty(MimeResponse.MARKUP_HEAD_ELEMENT, metaViewport);

/*
    metaViewport = response.createElement("link");
    metaViewport.setAttribute("rel", "apple-touch-icon");
    metaViewport.setAttribute("href", "/demo-extension/img/chat-icon.png");
    response.addProperty(MimeResponse.MARKUP_HEAD_ELEMENT, metaViewport);
*/

    //
    chain.doFilter(request, response);
  }
项目:portlet-pack    文件:ResponseFilter.java   
public void doFilter(RenderRequest request, RenderResponse response, FilterChain chain) throws IOException, PortletException
{

  String account = request.getPreferences().getValue("account", null);

  if (account!=null) {
    Element jQuery1 = response.createElement("script");
    jQuery1.setAttribute("type", "text/javascript");
    String textContent = "var _gaq = _gaq || [];\n" +
            "  _gaq.push(['_setAccount', '"+account+"']);\n" +
            "  _gaq.push(['_trackPageview']);\n" +
            "\n" +
            "  (function() {\n" +
            "    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n" +
            "    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n" +
            "    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n" +
            "  })();";

    jQuery1.setTextContent(textContent);
    response.addProperty(MimeResponse.MARKUP_HEAD_ELEMENT, jQuery1);
  }

  //
  chain.doFilter(request, response);
}
项目:class-guard    文件:AnnotationMethodHandlerExceptionResolver.java   
@Override
protected ModelAndView doResolveException(
        PortletRequest request, MimeResponse response, Object handler, Exception ex) {

    if (handler != null) {
        Method handlerMethod = findBestExceptionHandlerMethod(handler, ex);
        if (handlerMethod != null) {
            NativeWebRequest webRequest = new PortletWebRequest(request, response);
            try {
                Object[] args = resolveHandlerArguments(handlerMethod, handler, webRequest, ex);
                if (logger.isDebugEnabled()) {
                    logger.debug("Invoking request handler method: " + handlerMethod);
                }
                Object retVal = doInvokeMethod(handlerMethod, handler, args);
                return getModelAndView(retVal);
            }
            catch (Exception invocationEx) {
                logger.error("Invoking request method resulted in exception : " + handlerMethod, invocationEx);
            }
        }
    }
    return null;
}
项目:class-guard    文件:SimpleMappingExceptionResolver.java   
/**
 * Actually resolve the given exception that got thrown during on handler execution,
 * returning a ModelAndView that represents a specific error page if appropriate.
 * @param request current portlet request
 * @param response current portlet response
 * @param handler the executed handler, or null if none chosen at the time of
 * the exception (for example, if multipart resolution failed)
 * @param ex the exception that got thrown during handler execution
 * @return a corresponding ModelAndView to forward to, or null for default processing
 */
@Override
protected ModelAndView doResolveException(
        PortletRequest request, MimeResponse response, Object handler, Exception ex) {

    // Log exception, both at debug log level and at warn level, if desired.
    if (logger.isDebugEnabled()) {
        logger.debug("Resolving exception from handler [" + handler + "]: " + ex);
    }
    logException(ex, request);

    // Expose ModelAndView for chosen error view.
    String viewName = determineViewName(ex, request);
    if (viewName != null) {
        return getModelAndView(viewName, ex, request);
    }
    else {
        return null;
    }
}
项目:class-guard    文件:Portlet20AnnotationControllerTests.java   
public void render(String viewName, Map model, PortletRequest request, MimeResponse response) throws Exception {
    TestBean tb = (TestBean) model.get("testBean");
    if (tb == null) {
        tb = (TestBean) model.get("myCommand");
    }
    if (tb.getName().endsWith("myDefaultName")) {
        assertTrue(tb.getDate().getYear() == 107);
    }
    Errors errors = (Errors) model.get(BindingResult.MODEL_KEY_PREFIX + "testBean");
    if (errors == null) {
        errors = (Errors) model.get(BindingResult.MODEL_KEY_PREFIX + "myCommand");
    }
    if (errors.hasFieldErrors("date")) {
        throw new IllegalStateException();
    }
    List<TestBean> testBeans = (List<TestBean>) model.get("testBeanList");
    response.getWriter().write(viewName + "-" + tb.getName() + "-" + errors.getFieldError("age").getCode() +
            "-" + testBeans.get(0).getName() + "-" + model.get("myKey"));
}
项目:class-guard    文件:PortletAnnotationControllerTests.java   
public void render(String viewName, Map model, PortletRequest request, MimeResponse response) throws Exception {
    TestBean tb = (TestBean) model.get("testBean");
    if (tb == null) {
        tb = (TestBean) model.get("myCommand");
    }
    if (tb.getName().endsWith("myDefaultName")) {
        assertTrue(tb.getDate().getYear() == 107);
    }
    Errors errors = (Errors) model.get(BindingResult.MODEL_KEY_PREFIX + "testBean");
    if (errors == null) {
        errors = (Errors) model.get(BindingResult.MODEL_KEY_PREFIX + "myCommand");
    }
    if (errors.hasFieldErrors("date")) {
        throw new IllegalStateException();
    }
    List<TestBean> testBeans = (List<TestBean>) model.get("testBeanList");
    response.getWriter().write(viewName + "-" + tb.getName() + "-" + errors.getFieldError("age").getCode() +
            "-" + testBeans.get(0).getName() + "-" + model.get("myKey"));
}
项目:displaytag    文件:PortletRequestHelper.java   
/**
 * Creates a new request helper for the specified PageContext. Retrieves the PortletRequest and RenderResponse from
 * the PageContext.
 * @param pageContext Current JSP context.
 * @throws IllegalStateException If the PortletRequest or RenderResponse are not found in the PageContext.
 */
public PortletRequestHelper(PageContext pageContext)
{
    if (pageContext == null)
    {
        throw new IllegalArgumentException("pageContext may not be null");
    }

    this.portletRequest = (PortletRequest) pageContext.findAttribute(JAVAX_PORTLET_REQUEST);
    if (this.portletRequest == null)
    {
        throw new IllegalStateException("A PortletRequest could not be found in the PageContext for the key='"
            + JAVAX_PORTLET_REQUEST
            + "'");
    }

    this.renderResponse = (MimeResponse) pageContext.findAttribute(JAVAX_PORTLET_RESPONSE);
    if (this.portletRequest == null)
    {
        throw new IllegalStateException("A RenderResponse could not be found in the PageContext for the key='"
            + JAVAX_PORTLET_RESPONSE
            + "'");
    }
}
项目:portals-pluto    文件:RenderURLTag362.java   
@Override
public int doStartTag() throws JspException {

   Object obj = pageContext.getRequest().getAttribute(Constants.PORTLET_RESPONSE);
   if ((obj == null) || !(obj instanceof MimeResponse)) {
      throw new JspException("Could not obtain MimeResponse to create the URL.");
   }

   MimeResponse resp = (MimeResponse) obj;
   RenderURL rurl = null;
   if (isCopyCurrentRenderParameters() == true) {
      rurl = resp.createRenderURL(Copy.ALL);
   } else {
      rurl = resp.createRenderURL(Copy.NONE);
   }
   params = rurl.getRenderParameters();
   setUrl(rurl);

   handlePMandWS();
   handleDefaultEscapeXML();
   handleSecureFlag();

   return EVAL_BODY_INCLUDE;
}
项目:portals-pluto    文件:ActionURLTag362.java   
@Override
public int doStartTag() throws JspException {

   Object obj = pageContext.getRequest().getAttribute(Constants.PORTLET_RESPONSE);
   if ((obj == null) || !(obj instanceof MimeResponse)) {
      throw new JspException("Could not obtain MimeResponse to create the URL.");
   }

   MimeResponse resp = (MimeResponse) obj;
   ActionURL aurl = null;
   if (isCopyCurrentRenderParameters() == true) {
      aurl = resp.createActionURL(Copy.ALL);
   } else {
      aurl = resp.createActionURL(Copy.NONE);
   }
   rparams = aurl.getRenderParameters();
   aparams = aurl.getActionParameters();
   setUrl(aurl);

   handlePMandWS();
   handleDefaultEscapeXML();
   handleSecureFlag();

   return EVAL_BODY_INCLUDE;
}
项目:portals-pluto    文件:DispatcherTests2_SPEC2_19_IncludeJSPEvent_event.java   
@Override
public void render(RenderRequest portletReq, RenderResponse portletResp) throws PortletException, IOException {

   portletResp.setContentType("text/html");
   PrintWriter writer = portletResp.getWriter();
   writer.write("<h3>Event Companion Portlet </h3>\n");
   writer.write("<p>DispatcherTests2_SPEC2_19_IncludeJSPEvent_event</p>\n");

   String msg = (String) portletReq.getPortletSession().getAttribute(
         RESULT_ATTR_PREFIX + "DispatcherTests2_SPEC2_19_IncludeJSPEvent", APPLICATION_SCOPE);
   msg = (msg == null) ? "Not ready. click test case link." : msg;
   writer.write("<p>" + msg + "</p>\n");

   /* TestCase: V2DispatcherTests2_SPEC2_19_IncludeJSPEvent_dispatch2 */
   /* Details: "Parameters specified in the query strings must be */
   /* aggregated with the portlet render parameters" */
   PortletURL urlEvent = ((MimeResponse) portletResp).createRenderURL();
   urlEvent.setParameter("qparm2", "renderVal2");
   TestSetupLink tlEvent = new TestSetupLink(V2DISPATCHERTESTS2_SPEC2_19_INCLUDEJSPEVENT_DISPATCH2, urlEvent);
   tlEvent.writeTo(writer);

}
项目:portals-pluto    文件:DispatcherTests2_SPEC2_19_ForwardJSPEvent_event.java   
@Override
public void render(RenderRequest portletReq, RenderResponse portletResp) throws PortletException, IOException {

   portletResp.setContentType("text/html");
   PrintWriter writer = portletResp.getWriter();
   writer.write("<h3>Event Companion Portlet </h3>\n");
   writer.write("<p>DispatcherTests2_SPEC2_19_ForwardJSPEvent_event</p>\n");

   String msg = (String) portletReq.getPortletSession().getAttribute(
         RESULT_ATTR_PREFIX + "DispatcherTests2_SPEC2_19_ForwardJSPEvent", APPLICATION_SCOPE);
   msg = (msg == null) ? "Not ready. click test case link." : msg;
   writer.write("<p>" + msg + "</p>\n");

   /* TestCase: V2DispatcherTests2_SPEC2_19_ForwardJSPEvent_dispatch2 */
   /* Details: "Parameters specified in the query strings must be */
   /* aggregated with the portlet render parameters" */
   PortletURL urlEvent = ((MimeResponse) portletResp).createRenderURL();
   urlEvent.setParameter("qparm2", "renderVal2");
   TestSetupLink tlEvent = new TestSetupLink(V2DISPATCHERTESTS2_SPEC2_19_FORWARDJSPEVENT_DISPATCH2, urlEvent);
   tlEvent.writeTo(writer);

}
项目:portals-pluto    文件:DispatcherTests3S_SPEC2_19_ForwardServletResource_servlet.java   
protected void processTCKReq(HttpServletRequest request, HttpServletResponse response) throws ServletException,
      IOException {

   PortletRequest portletReq = (PortletRequest) request.getAttribute("javax.portlet.request");
   PortletResponse portletResp = (PortletResponse) request.getAttribute("javax.portlet.response");
   request.getAttribute("javax.portlet.config");
   Thread.currentThread().getId();
   portletReq.getAttribute(THREADID_ATTR);

   PrintWriter writer = ((MimeResponse) portletResp).getWriter();

   // Create result objects for the tests

   PortletURL purl = ((MimeResponse) portletResp).createRenderURL();
   TestLink tl = new TestLink(V2DISPATCHERTESTS3S_SPEC2_19_FORWARDSERVLETRESOURCE_DISPATCH4, purl);
   tl.writeTo(writer);

}
项目:spring4-understanding    文件:DispatcherPortlet.java   
/**
 * Actually render the given view.
 * <p>The default implementation delegates to
 * {@link org.springframework.web.servlet.ViewRendererServlet}.
 * @param view the View to render
 * @param model the associated model
 * @param request current portlet render/resource request
 * @param response current portlet render/resource response
 * @throws Exception if there's a problem rendering the view
 */
protected void doRender(View view, Map<String, ?> model, PortletRequest request, MimeResponse response) throws Exception {
    // Expose Portlet ApplicationContext to view objects.
    request.setAttribute(ViewRendererServlet.WEB_APPLICATION_CONTEXT_ATTRIBUTE, getPortletApplicationContext());

    // These attributes are required by the ViewRendererServlet.
    request.setAttribute(ViewRendererServlet.VIEW_ATTRIBUTE, view);
    request.setAttribute(ViewRendererServlet.MODEL_ATTRIBUTE, model);

    // Include the content of the view in the render/resource response.
    doDispatch(getPortletContext().getRequestDispatcher(this.viewRendererUrl), request, response);
}
项目:spring4-understanding    文件:DispatcherPortlet.java   
/**
 * Perform a dispatch on the given PortletRequestDispatcher.
 * <p>The default implementation uses a forward for resource requests
 * and an include for render requests.
 * @param dispatcher the PortletRequestDispatcher to use
 * @param request current portlet render/resource request
 * @param response current portlet render/resource response
 * @throws Exception if there's a problem performing the dispatch
 */
protected void doDispatch(PortletRequestDispatcher dispatcher, PortletRequest request, MimeResponse response)
        throws Exception {

    // In general, we prefer a forward for resource responses, in order to have full Servlet API
    // support in the target resource (e.g. on uPortal). However, on Liferay, a resource forward
    // displays an empty page, so we have to resort to an include there...
    if (PortletRequest.RESOURCE_PHASE.equals(request.getAttribute(PortletRequest.LIFECYCLE_PHASE)) &&
            !dispatcher.getClass().getName().startsWith("com.liferay")) {
        dispatcher.forward(request, response);
    }
    else {
        dispatcher.include(request, response);
    }
}
项目:spring4-understanding    文件:PortletContentGenerator.java   
/**
 * Apply the given cache seconds to the render response
 * @param response current portlet render response
 * @param seconds positive number of seconds into the future that the
 * response should be cacheable for, 0 to prevent caching
 */
protected final void applyCacheSeconds(MimeResponse response, int seconds) {
    if (seconds > 0) {
        cacheForSeconds(response, seconds);
    }
    else if (seconds == 0) {
        preventCaching(response);
    }
    // Leave caching to the portlet configuration otherwise.
}
项目:community-edition-old    文件:AlfrescoFacesPortlet.java   
/**
 * Creates a resource URL from the given faces context.
 * 
 * @param context
 *            the faces context
 * @return the resource URL
 */
public static String getResourceURL(FacesContext context, String path)
{
    MimeResponse portletResponse = (MimeResponse) context.getExternalContext().getResponse();
    ResourceURL resourceURL = portletResponse.createResourceURL();
    resourceURL.setResourceID(path);
    return resourceURL.toString();
}
项目:class-guard    文件:DispatcherPortlet.java   
/**
 * Actually render the given view.
 * <p>The default implementation delegates to
 * {@link org.springframework.web.servlet.ViewRendererServlet}.
 * @param view the View to render
 * @param model the associated model
 * @param request current portlet render/resource request
 * @param response current portlet render/resource response
 * @throws Exception if there's a problem rendering the view
 */
protected void doRender(View view, Map model, PortletRequest request, MimeResponse response) throws Exception {
    // Expose Portlet ApplicationContext to view objects.
    request.setAttribute(ViewRendererServlet.WEB_APPLICATION_CONTEXT_ATTRIBUTE, getPortletApplicationContext());

    // These attributes are required by the ViewRendererServlet.
    request.setAttribute(ViewRendererServlet.VIEW_ATTRIBUTE, view);
    request.setAttribute(ViewRendererServlet.MODEL_ATTRIBUTE, model);

    // Include the content of the view in the render/resource response.
    doDispatch(getPortletContext().getRequestDispatcher(this.viewRendererUrl), request, response);
}
项目:class-guard    文件:DispatcherPortlet.java   
/**
 * Perform a dispatch on the given PortletRequestDispatcher.
 * <p>The default implementation uses a forward for resource requests
 * and an include for render requests.
 * @param dispatcher the PortletRequestDispatcher to use
 * @param request current portlet render/resource request
 * @param response current portlet render/resource response
 * @throws Exception if there's a problem performing the dispatch
 */
protected void doDispatch(PortletRequestDispatcher dispatcher, PortletRequest request, MimeResponse response)
        throws Exception {

    // In general, we prefer a forward for resource responses, in order to have full Servlet API
    // support in the target resource (e.g. on uPortal). However, on Liferay, a resource forward
    // displays an empty page, so we have to resort to an include there...
    if (PortletRequest.RESOURCE_PHASE.equals(request.getAttribute(PortletRequest.LIFECYCLE_PHASE)) &&
            !dispatcher.getClass().getName().startsWith("com.liferay")) {
        dispatcher.forward(request, response);
    }
    else {
        dispatcher.include(request, response);
    }
}
项目:class-guard    文件:PortletContentGenerator.java   
/**
 * Apply the given cache seconds to the render response
 * @param response current portlet render response
 * @param seconds positive number of seconds into the future that the
 * response should be cacheable for, 0 to prevent caching
 */
protected final void applyCacheSeconds(MimeResponse response, int seconds) {
    if (seconds > 0) {
        cacheForSeconds(response, seconds);
    }
    else if (seconds == 0) {
        preventCaching(response);
    }
    // Leave caching to the portlet configuration otherwise.
}
项目:displaytag    文件:PortletHref.java   
/**
 * Creates a new PortletHref. The actual PortletURL object is not generated until the toString method is called.
 * @param portletRequest request to to feature checking with, may not be null.
 * @param renderResponse response to generate the URLs from, may not be null.
 */
public PortletHref(PortletRequest portletRequest, MimeResponse renderResponse)
{
    if (portletRequest == null)
    {
        throw new IllegalArgumentException("portletRequest may not be null");
    }
    if (renderResponse == null)
    {
        throw new IllegalArgumentException("renderResponse may not be null");
    }

    this.portletRequest = portletRequest;
    this.renderResponse = renderResponse;
}
项目:portals-pluto    文件:Utils.java   
public boolean checkEqualMimeResponse(MimeResponse injectedPortletArtifact,
      MimeResponse mimeResponse) {
   if (injectedPortletArtifact.equals(mimeResponse)) {
      return true;
   }
   int injectedBufferSize = injectedPortletArtifact.getBufferSize();
   int portletBufferSize = mimeResponse.getBufferSize();
   String injectedCharacterEncoding = injectedPortletArtifact
         .getCharacterEncoding();
   String portletCharacterEncoding = mimeResponse.getCharacterEncoding();
   String injectedContentType = injectedPortletArtifact.getContentType();
   String portletContentType = mimeResponse.getContentType();      

   if (checkEqualResponses(injectedPortletArtifact, mimeResponse)

         && injectedBufferSize == portletBufferSize

         && ((injectedCharacterEncoding == null && portletCharacterEncoding == null) ||
              injectedCharacterEncoding.equals(portletCharacterEncoding))

         && (injectedContentType == null && portletContentType == null) ||
            injectedContentType.equals(portletContentType)

         ) {
      return true;
   } else {
      return false;
   }
}
项目:portals-pluto    文件:DispatcherTests4_SPEC2_19_ForwardServletRender_servlet.java   
protected void processTCKReq(HttpServletRequest request, HttpServletResponse response) throws ServletException,
      IOException {

   PortletRequest portletReq = (PortletRequest) request.getAttribute("javax.portlet.request");
   PortletResponse portletResp = (PortletResponse) request.getAttribute("javax.portlet.response");
   request.getAttribute("javax.portlet.config");
   Thread.currentThread().getId();
   portletReq.getAttribute(THREADID_ATTR);

   PrintWriter writer = ((MimeResponse) portletResp).getWriter();

   JSR286DispatcherTestCaseDetails tcd = new JSR286DispatcherTestCaseDetails();

   // Create result objects for the tests

   /* TestCase: V2DispatcherTests4_SPEC2_19_ForwardServletRender_invoke3 */
   /* Details: "Parameters to the forward method for a target servlet */
   /* can be wrapped request and response classes from the portlet */
   /* lifecyle method initiating the include" */
   TestResult tr0 = tcd.getTestResultFailed(V2DISPATCHERTESTS4_SPEC2_19_FORWARDSERVLETRENDER_INVOKE3);
   try {
      // If this gets executed, include worked.
      tr0.setTcSuccess(true);
   } catch (Exception e) {
      tr0.appendTcDetail(e.toString());
   }
   tr0.writeTo(writer);

}
项目:portals-pluto    文件:DispatcherTests4_SPEC2_19_ForwardServletResource_servlet.java   
protected void processTCKReq(HttpServletRequest request, HttpServletResponse response) throws ServletException,
      IOException {

   PortletRequest portletReq = (PortletRequest) request.getAttribute("javax.portlet.request");
   PortletResponse portletResp = (PortletResponse) request.getAttribute("javax.portlet.response");
   request.getAttribute("javax.portlet.config");
   Thread.currentThread().getId();
   portletReq.getAttribute(THREADID_ATTR);

   PrintWriter writer = ((MimeResponse) portletResp).getWriter();

   JSR286DispatcherTestCaseDetails tcd = new JSR286DispatcherTestCaseDetails();

   // Create result objects for the tests

   /* TestCase: V2DispatcherTests4_SPEC2_19_ForwardServletResource_invoke3 */
   /* Details: "Parameters to the forward method for a target servlet */
   /* can be wrapped request and response classes from the portlet */
   /* lifecyle method initiating the include" */
   TestResult tr0 = tcd.getTestResultFailed(V2DISPATCHERTESTS4_SPEC2_19_FORWARDSERVLETRESOURCE_INVOKE3);
   try {
      // If this gets executed, include worked.
      tr0.setTcSuccess(true);
   } catch (Exception e) {
      tr0.appendTcDetail(e.toString());
   }
   tr0.writeTo(writer);

}
项目:portals-pluto    文件:RenderResponseWrapperChecker.java   
@SuppressWarnings("unchecked")
@Override
public PortletURL createRenderURL() {
   String meth = "createRenderURL";
   Object[] args = {};
   PortletURL ret = ((MimeResponse) resp).createRenderURL();
   retVal = ret;
   checkArgs(meth, args);
   return ret;
}
项目:portals-pluto    文件:RenderResponseWrapperChecker.java   
@SuppressWarnings("unchecked")
@Override
public PortletURL createActionURL() {
   String meth = "createActionURL";
   Object[] args = {};
   PortletURL ret = ((MimeResponse) resp).createRenderURL();
   retVal = ret;
   checkArgs(meth, args);
   return ret;
}
项目:portals-pluto    文件:RenderResponseWrapperChecker.java   
@Override
public ResourceURL createResourceURL() {
   String meth = "createResourceURL";
   Object[] args = {};
   ResourceURL ret = ((MimeResponse) resp).createResourceURL();
   retVal = ret;
   checkArgs(meth, args);
   return ret;
}
项目:portals-pluto    文件:RenderResponseWrapperChecker.java   
@Override
public CacheControl getCacheControl() {
   String meth = "getCacheControl";
   Object[] args = {};
   CacheControl ret = ((MimeResponse) resp).getCacheControl();
   retVal = ret;
   checkArgs(meth, args);
   return ret;
}
项目:portals-pluto    文件:ResourceResponseWrapperChecker.java   
@Override
public CacheControl getCacheControl() {
   String meth = "getCacheControl";
   Object[] args = {};
   CacheControl ret = ((MimeResponse) resp).getCacheControl();
   retVal = ret;
   checkArgs(meth, args);
   return ret;
}
项目:portals-pluto    文件:ResourceResponseWrapperChecker.java   
@SuppressWarnings("unchecked")
@Override
public PortletURL createRenderURL() {
   String meth = "createRenderURL";
   Object[] args = {};
   PortletURL ret = ((MimeResponse) resp).createRenderURL();
   retVal = ret;
   checkArgs(meth, args);
   return ret;
}
项目:portals-pluto    文件:ResourceResponseWrapperChecker.java   
@SuppressWarnings("unchecked")
@Override
public PortletURL createActionURL() {
   String meth = "createActionURL";
   Object[] args = {};
   PortletURL ret = ((MimeResponse) resp).createActionURL();
   retVal = ret;
   checkArgs(meth, args);
   return ret;
}
项目:portals-pluto    文件:ResourceResponseWrapperChecker.java   
@Override
public ResourceURL createResourceURL() {
   String meth = "createResourceURL";
   Object[] args = {};
   ResourceURL ret = ((MimeResponse) resp).createResourceURL();
   retVal = ret;
   checkArgs(meth, args);
   return ret;
}
项目:portals-pluto    文件:DispatcherReqRespTests5S_SPEC2_19_IncludeServletResourceRequest_servlet.java   
protected void processTCKReq(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {

   PortletResponse portletResp = (PortletResponse) request.getAttribute("javax.portlet.response");

   PrintWriter writer = ((MimeResponse)portletResp).getWriter();

   JSR286DispatcherReqRespTestCaseDetails tcd = new JSR286DispatcherReqRespTestCaseDetails();

   // Create result objects for the tests

   /* TestCase: V2DispatcherReqRespTests5S_SPEC2_19_IncludeServletResourceRequest_getInputStream */
   /* Details: "In a target servlet of a include in the Resource phase,    */
   /* the method HttpServletRequest.getInputStream must provide the same   */
   /* functionality as ResourceRequest.getPortletInputStream"              */
   TestResult tr0 = tcd.getTestResultSucceeded(V2DISPATCHERREQRESPTESTS5S_SPEC2_19_INCLUDESERVLETRESOURCEREQUEST_GETINPUTSTREAM);
   tr0.appendTcDetail("Can't be implemented.");
   tr0.writeTo(writer);

   /* TestCase: V2DispatcherReqRespTests5S_SPEC2_19_IncludeServletResourceRequest_setCharacterEncoding */
   /* Details: "In a target servlet of a include in the Resource phase,    */
   /* the method HttpServletRequest.setCharacterEncoding must provide      */
   /* the same functionality as ResourceRequest.setCharacterEncoding"      */
   TestResult tr1 = tcd.getTestResultSucceeded(V2DISPATCHERREQRESPTESTS5S_SPEC2_19_INCLUDESERVLETRESOURCEREQUEST_SETCHARACTERENCODING);
   tr1.appendTcDetail("Can't be implemented.");
   tr1.writeTo(writer);


}
项目:portals-pluto    文件:DispatcherReqRespTests5S_SPEC2_19_ForwardServletResourceRequest_servlet.java   
protected void processTCKReq(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {

   PortletResponse portletResp = (PortletResponse) request.getAttribute("javax.portlet.response");

   PrintWriter writer = ((MimeResponse)portletResp).getWriter();

   JSR286DispatcherReqRespTestCaseDetails tcd = new JSR286DispatcherReqRespTestCaseDetails();

   // Create result objects for the tests

   /* TestCase: V2DispatcherReqRespTests5S_SPEC2_19_ForwardServletResourceRequest_getInputStream */
   /* Details: "In a target servlet of a forward in the Resource phase,    */
   /* the method HttpServletRequest.getInputStream must provide the same   */
   /* functionality as ResourceRequest.getPortletInputStream"              */
   TestResult tr0 = tcd.getTestResultSucceeded(V2DISPATCHERREQRESPTESTS5S_SPEC2_19_FORWARDSERVLETRESOURCEREQUEST_GETINPUTSTREAM);
   tr0.appendTcDetail("Can't be implemented.");
   tr0.writeTo(writer);

   /* TestCase: V2DispatcherReqRespTests5S_SPEC2_19_ForwardServletResourceRequest_setCharacterEncoding */
   /* Details: "In a target servlet of a forward in the Resource phase,    */
   /* the method HttpServletRequest.setCharacterEncoding must provide      */
   /* the same functionality as ResourceRequest.setCharacterEncoding"      */
   TestResult tr1 = tcd.getTestResultSucceeded(V2DISPATCHERREQRESPTESTS5S_SPEC2_19_FORWARDSERVLETRESOURCEREQUEST_SETCHARACTERENCODING);
   tr1.appendTcDetail("Can't be implemented.");
   tr1.writeTo(writer);


}
项目:portals-pluto    文件:HttpServletPortletResponseWrapper.java   
@Override
public int getBufferSize() {
   if (portletResponse instanceof MimeResponse) {
      return ((MimeResponse) portletResponse).getBufferSize();
   }
   return 0;
}
项目:portals-pluto    文件:HttpServletPortletResponseWrapper.java   
@Override
public String getCharacterEncoding() {
   if (portletResponse instanceof MimeResponse) {
      return ((MimeResponse) portletResponse).getCharacterEncoding(); 
   }
   return null;
}
项目:portals-pluto    文件:HttpServletPortletResponseWrapper.java   
@Override
public String getContentType() {
   if (portletResponse instanceof MimeResponse) {
      return ((MimeResponse) portletResponse).getContentType(); 
   }
   return null;
}
项目:portals-pluto    文件:HttpServletPortletResponseWrapper.java   
@Override
public Locale getLocale() {
   if (portletResponse instanceof MimeResponse) {
      return ((MimeResponse) portletResponse).getLocale(); 
   }
   return null;
}
项目:portals-pluto    文件:HttpServletPortletResponseWrapper.java   
@Override
public ServletOutputStream getOutputStream() throws IOException {
   if (servletOutputStream == null) {
      outputStream = (portletResponse instanceof MimeResponse) ? ((MimeResponse) portletResponse)
            .getPortletOutputStream() : DummyServletOutputStream.getInstance();
      if (outputStream instanceof ServletOutputStream) {
         servletOutputStream = (ServletOutputStream) outputStream;
      } else {
         servletOutputStream = new ServletOutputStream() {
            @Override
            public void write(int b) throws IOException {
               outputStream.write(b);
            }

            @Override
            public boolean isReady() {
               // Servlet 3.1 API. Not implemented.
               return true;
            }

            @Override
            public void setWriteListener(WriteListener arg0) {
               // Servlet 3.1 API. Not implemented.
            }
         };
      }
   }
   return servletOutputStream;
}