@Override public void render(RenderRequest portletReq, RenderResponse portletResp) throws PortletException, IOException { LOGGER.entering(LOG_CLASS, "main portlet render entry"); long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); PrintWriter writer = portletResp.getWriter(); writer.write( "<div id=\"DispatcherTests_SPEC2_19_ForwardServletResource\">no resource output.</div>\n"); ResourceURL resurl = portletResp.createResourceURL(); resurl.setCacheability(PAGE); writer.write("<script>\n"); writer.write("(function () {\n"); writer.write(" var xhr = new XMLHttpRequest();\n"); writer.write(" xhr.onreadystatechange=function() {\n"); writer.write(" if (xhr.readyState==4 && xhr.status==200) {\n"); writer.write( " document.getElementById(\"DispatcherTests_SPEC2_19_ForwardServletResource\").innerHTML=xhr.responseText;\n"); writer.write(" }\n"); writer.write(" };\n"); writer.write(" xhr.open(\"GET\",\"" + resurl.toString() + "\",true);\n"); writer.write(" xhr.send();\n"); writer.write("})();\n"); writer.write("</script>\n"); }
@Override public void render(RenderRequest portletReq, RenderResponse portletResp) throws PortletException, IOException { LOGGER.entering(LOG_CLASS, "main portlet render entry"); long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); PrintWriter writer = portletResp.getWriter(); PortletSession ps = portletReq.getPortletSession(); String msg = (String) ps.getAttribute( RESULT_ATTR_PREFIX + "DispatcherReqRespTests3_SPEC2_19_IncludeJSPActionResponse", APPLICATION_SCOPE); if (msg != null) { writer.write("<p>" + msg + "</p><br/>\n"); ps.removeAttribute( RESULT_ATTR_PREFIX + "DispatcherReqRespTests3_SPEC2_19_IncludeJSPActionResponse", APPLICATION_SCOPE); } /* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPActionResponse_containsHeader */ /* Details: "In a target jsp of a include in the Action phase, the */ /* method HttpServletResponse.containsHeader must return false" */ { PortletURL aurl = portletResp.createActionURL(); aurl.setParameters(portletReq.getPrivateParameterMap()); TestButton tb = new TestButton( "V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPActionResponse_containsHeader", aurl); tb.writeTo(writer); } /* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPActionResponse_encodeRedirectURL1 */ /* Details: "In a target jsp of a include in the Action phase, the */ /* method HttpServletResponse.encodeRedirectURL must return null" */ { PortletURL aurl = portletResp.createActionURL(); aurl.setParameters(portletReq.getPrivateParameterMap()); TestButton tb = new TestButton( "V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPActionResponse_encodeRedirectURL1", aurl); tb.writeTo(writer); } /* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPActionResponse_encodeRedirectUrl */ /* Details: "In a target jsp of a include in the Action phase, the */ /* method HttpServletResponse.encodeRedirectUrl must return null" */ { PortletURL aurl = portletResp.createActionURL(); aurl.setParameters(portletReq.getPrivateParameterMap()); TestButton tb = new TestButton( "V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPActionResponse_encodeRedirectUrl", aurl); tb.writeTo(writer); } /* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPActionResponse_encodeURL1 */ /* Details: "In a target jsp of a include in the Action phase, the */ /* method HttpServletResponse.encodeURL must provide the same */ /* functionality as ActionResponse.encodeURL" */ { PortletURL aurl = portletResp.createActionURL(); aurl.setParameters(portletReq.getPrivateParameterMap()); TestButton tb = new TestButton( "V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPActionResponse_encodeURL1", aurl); tb.writeTo(writer); } /* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPActionResponse_encodeUrl */ /* Details: "In a target jsp of a include in the Action phase, the */ /* method HttpServletResponse.encodeUrl must provide the same */ /* functionality as ActionResponse.encodeURL" */ { PortletURL aurl = portletResp.createActionURL(); aurl.setParameters(portletReq.getPrivateParameterMap()); TestButton tb = new TestButton( "V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPActionResponse_encodeUrl", aurl); tb.writeTo(writer); } /* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPActionResponse_getBufferSize */ /* Details: "In a target jsp of a include in the Action phase, the */ /* method HttpServletResponse.getBufferSize must return 0" */ { PortletURL aurl = portletResp.createActionURL(); aurl.setParameters(portletReq.getPrivateParameterMap()); TestButton tb = new TestButton( "V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPActionResponse_getBufferSize", aurl); tb.writeTo(writer); } /* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPActionResponse_getCharacterEncoding */ /* Details: "In a target jsp of a include in the Action phase, the */ /* method HttpServletResponse.getCharacterEncoding must return null" */ { PortletURL aurl = portletResp.createActionURL(); aurl.setParameters(portletReq.getPrivateParameterMap()); TestButton tb = new TestButton( "V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPActionResponse_getCharacterEncoding", aurl); tb.writeTo(writer); } /* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPActionResponse_getContentType */ /* Details: "In a target jsp of a include in the Action phase, the */ /* method HttpServletResponse.getContentType must return null" */ { PortletURL aurl = portletResp.createActionURL(); aurl.setParameters(portletReq.getPrivateParameterMap()); TestButton tb = new TestButton( "V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPActionResponse_getContentType", aurl); tb.writeTo(writer); } /* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPActionResponse_getLocale */ /* Details: "In a target jsp of a include in the Action phase, the */ /* method HttpServletResponse.getLocale must return null" */ { PortletURL aurl = portletResp.createActionURL(); aurl.setParameters(portletReq.getPrivateParameterMap()); TestButton tb = new TestButton( "V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPActionResponse_getLocale", aurl); tb.writeTo(writer); } /* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPActionResponse_isCommitted */ /* Details: "In a target jsp of a include in the Action phase, the */ /* method HttpServletResponse.isCommitted must return true" */ { PortletURL aurl = portletResp.createActionURL(); aurl.setParameters(portletReq.getPrivateParameterMap()); TestButton tb = new TestButton( "V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPActionResponse_isCommitted", aurl); tb.writeTo(writer); } }