1 Reply Latest reply on Sep 5, 2012 2:45 PM by Davegrimm-Oracle

    Parameters lost in handleViewRenderRequest


      Has anyone experienced the lost of parameters in the handleViewRenderRequest?

      Our portlet which was working previously in DF1.4 was using a renderURL tag which also passed parameter.

      <portlet:renderURL var="printUrl" escapeXml="false" windowState="${windowStatePopup}" portletMode="VIEW">
           <portlet:param name="print" value="true"/>

      This worked in DF1.4, however after uplifting our portlet to 2.3 this has stop passing the parameter.

      It is clearly in the URL: http://localhost:8080/web/guest/home?p_p_id=endecacordachartportlet_WAR_endecacordachartportlet_INSTANCE_tO5v&_endecacordachartportlet_WAR_endecacordachartportlet_INSTANCE_tO5v_print=true&p_p_lifecycle=0&p_p_state=pop_up&p_p_mode=view

      However after it is done with the doView function, the request no longer contains the parameter. Has something changed in Lat 2.3 that would strip parameters?
        • 1. Re: Parameters lost in handleViewRenderRequest
          I don't think anything has changed between these two versions. In fact, the new Chart component handles the "print" parameter in the same way as the Corda Chart component did in 1.x. You get the parameter in handleViewRenderRequest and immediately save it to a request attribute so that it can be used throughout the request. The parameter is indeed lost to some of the other classes that want to use it.

                    String printMode = request.getParameter(PARAM_PRINT_MODE);

                    if (printMode != null && "true".equalsIgnoreCase(printMode)) {
                         request.setAttribute(REQUEST_ATTRIBUTE_PRINT_MODE, "true");
                         addBreadcrumbContext(request, response); // Adds extra query, so only do this in print mode

                    } else {
                         request.setAttribute(REQUEST_ATTRIBUTE_PRINT_MODE, "false");

          So, after doing this, you can use REQUEST_ATTRIBUTE_PRINT_MODE instead of PARAM_PRINT_MODE wherever you need it.