@Override protected void doServeResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws Exception { String cmd = ParamUtil.getString(resourceRequest, Constants.CMD); PortletRequestDispatcher portletRequestDispatcher = null; if (cmd.equals(Constants.IMPORT)) { portletRequestDispatcher = getPortletRequestDispatcher(resourceRequest, "/import/processes_list/view.jsp"); } else { portletRequestDispatcher = getPortletRequestDispatcher(resourceRequest, "/import/new_import/import_task_records_resources.jsp"); } portletRequestDispatcher.include(resourceRequest, resourceResponse); }
@Override protected void doServeResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws Exception { String cmd = ParamUtil.getString(resourceRequest, Constants.CMD); PortletRequestDispatcher portletRequestDispatcher = null; if (cmd.equals(Constants.IMPORT)) { portletRequestDispatcher = getPortletRequestDispatcher(resourceRequest, "/import/processes_list/view.jsp"); } else { portletRequestDispatcher = getPortletRequestDispatcher(resourceRequest, "/import/new_import/import_contacts_resources.jsp"); } portletRequestDispatcher.include(resourceRequest, resourceResponse); }
@Override protected void doServeResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws Exception { // _log.info("doServeResource()"); String cmd = ParamUtil.getString(resourceRequest, Constants.CMD); // _log.info("cmd = " + cmd); PortletRequestDispatcher portletRequestDispatcher = null; if (cmd.equals(Constants.IMPORT)) { portletRequestDispatcher = getPortletRequestDispatcher(resourceRequest, "/import/processes_list/view.jsp"); } else { portletRequestDispatcher = getPortletRequestDispatcher(resourceRequest, "/import/new_import/import_measurements_resources.jsp"); } portletRequestDispatcher.include(resourceRequest, resourceResponse); }
/** * Serve the resource as specified in the given request to the given response, * using the PortletContext's request dispatcher. * <p>This is roughly equivalent to Portlet 2.0 GenericPortlet. * @param request the current resource request * @param response the current resource response * @param context the current Portlet's PortletContext * @throws PortletException propagated from Portlet API's forward method * @throws IOException propagated from Portlet API's forward method */ public static void serveResource(ResourceRequest request, ResourceResponse response, PortletContext context) throws PortletException, IOException { String id = request.getResourceID(); if (id != null) { if (!PortletUtils.isProtectedResource(id)) { PortletRequestDispatcher rd = context.getRequestDispatcher(id); if (rd != null) { rd.forward(request, response); return; } } response.setProperty(ResourceResponse.HTTP_STATUS_CODE, "404"); } }
public void perform(TaskRequest req, TaskResponse res) { RenderRequest preq = (RenderRequest) request.evaluate(req, res); RenderResponse pres = (RenderResponse) response.evaluate(req, res); String rsc = (String) resource.evaluate(req, res); try { // Load the PortletRequest... for (String key : req.getAttributeNames()) { preq.setAttribute(key, req.getAttribute(key)); } PortletRequestDispatcher prd = preq.getPortletSession(true).getPortletContext().getRequestDispatcher(rsc); prd.include(preq, pres); } catch (Throwable t) { String msg = "Error dispatching to the specified resource: " + rsc; throw new RuntimeException(msg, t); } }
@Override protected void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException { AccessToken accessToken = getAccessToken(); final Twitter twitter = getOAuthProvider().getAuthorizedSocialApiObject(accessToken, Twitter.class); User twitterUser = new TwitterPortletRequest<User>(request, response, getPortletContext(), getOAuthProvider()) { @Override protected User invokeRequest() throws TwitterException { return twitter.verifyCredentials(); } }.executeRequest(); if (twitterUser != null) { request.setAttribute("twitterUserInfo", twitterUser); PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/jsp/twitter/userinfo.jsp"); prd.include(request, response); } }
public T executeRequest() throws IOException, PortletException { try { return invokeRequest(); } catch (TwitterException te) { String jspErrorPage; if (te.getStatusCode() == 401) { request.setAttribute(OAuthPortletFilter.ATTRIBUTE_ERROR_MESSAGE, "Twitter access token is invalid."); request.setAttribute(OAuthPortletFilter.ATTRIBUTE_OAUTH_PROVIDER, oauthProvider); jspErrorPage = "/jsp/error/token.jsp"; } else { request.setAttribute(OAuthPortletFilter.ATTRIBUTE_ERROR_MESSAGE, getErrorMessage(te)); jspErrorPage = "/jsp/error/error.jsp"; } System.err.println(getErrorMessage(te)); PortletRequestDispatcher prd = portletContext.getRequestDispatcher(jspErrorPage); prd.include(request, response); } return null; }
@Override protected void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException { AccessToken accessToken = getAccessToken(); final Oauth2 service = getOAuthProvider().getAuthorizedSocialApiObject(accessToken, Oauth2.class); Userinfo userInfo = new GooglePortletRequest<Userinfo>(request, response, getPortletContext(), getOAuthProvider(), REQUIRED_SCOPE) { @Override protected Userinfo invokeRequest() throws IOException { return service.userinfo().v2().me().get().execute(); } }.executeRequest(); if (userInfo != null) { request.setAttribute(GOOGLE_USER_INFO, userInfo); } PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/jsp/google/userinfo.jsp"); prd.include(request, response); }
protected AccessToken loadAccessTokenOrRedirectToObtainIt(String username, OAuthProvider oauthProvider, RenderRequest request, RenderResponse response) throws IOException, PortletException { // Try requestContext first. Otherwise obtain OAuthProvider via API AccessToken accessToken = requestContext.getAccessToken(oauthProviderKey); if (accessToken == null) { accessToken = oauthProvider.loadAccessToken(username); } if (accessToken == null) { // Will be processed by method AbstractSocialPortlet.actionRedirectToOAuthFlow PortletURL actionURL = response.createActionURL(); actionURL.setParameter(ActionRequest.ACTION_NAME, AbstractSocialPortlet.ACTION_OAUTH_REDIRECT); request.setAttribute(ATTRIBUTE_ERROR_MESSAGE, oauthProvider.getFriendlyName() + " access token not available for you."); request.setAttribute(ATTRIBUTE_OAUTH_PROVIDER, oauthProvider); PortletRequestDispatcher prd = filterConfig.getPortletContext().getRequestDispatcher("/jsp/error/token.jsp"); prd.include(request, response); } return accessToken; }
@Override public void render(RenderRequest portletReq, RenderResponse portletResp) throws PortletException, IOException { long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); // Prereq for: V2DispatcherReqRespTests2_SPEC2_19_ForwardServletRenderRequest_getAttribute portletReq.setAttribute(ATTR_PREFIX +"V2DispatcherReqRespTests2_SPEC2_19_ForwardServletRenderRequest_getAttribute", "Value1"); // Prereq for: V2DispatcherReqRespTests2_SPEC2_19_ForwardServletRenderRequest_getAttributeNames portletReq.setAttribute(ATTR_PREFIX + "V2DispatcherReqRespTests2_SPEC2_19_ForwardServletRenderRequest_getAttributeNames", "Value1"); // Now do the actual dispatch String target = SERVLET_PREFIX + "DispatcherReqRespTests2_SPEC2_19_ForwardServletRenderRequest_servlet" + SERVLET_SUFFIX + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext() .getRequestDispatcher(target); rd.forward(portletReq, portletResp); }
protected TestResult checkSameNameParameter(PortletContext context, PortletRequest request, PortletResponse response) throws IOException, PortletException { // Dispatch to the companion servlet: call checkSameNameParameter(). StringBuffer buffer = new StringBuffer(); buffer.append(SERVLET_PATH).append("?") .append(KEY_TARGET).append("=").append(TARGET_SAME_NAME_PARAM) .append("&").append(KEY_C).append("=").append(VALUE_C1) .append("&").append(KEY_C).append("=").append(VALUE_C2) .append("&").append(KEY_C).append("=").append(VALUE_C3); if (LOG.isDebugEnabled()) { LOG.debug("Dispatching to: " + buffer.toString()); } PortletRequestDispatcher dispatcher = context.getRequestDispatcher( buffer.toString()); dispatcher.include((RenderRequest) request, (RenderResponse) response); // Retrieve test result returned by the companion servlet. TestResult result = (TestResult) request.getAttribute(RESULT_KEY); request.removeAttribute(RESULT_KEY); return result; }
protected TestResult checkAddedSameNameParameter(PortletContext context, PortletRequest request, PortletResponse response) throws IOException, PortletException { // Dispatch to the companion servlet: call checkAddedSameNameParameter(). StringBuffer buffer = new StringBuffer(); buffer.append(SERVLET_PATH).append("?") .append(KEY_TARGET).append("=").append(TARGET_ADDED_SAME_NAME_PARAM) .append("&").append(KEY_RENDER).append("=").append(VALUE_ADDED1) .append("&").append(KEY_RENDER).append("=").append(VALUE_ADDED2); if (LOG.isDebugEnabled()) { LOG.debug("Dispatching to: " + buffer.toString()); } PortletRequestDispatcher dispatcher = context.getRequestDispatcher( buffer.toString()); dispatcher.include((RenderRequest) request, (RenderResponse) response); // Retrieve test result returned by the companion servlet. TestResult result = (TestResult) request.getAttribute(RESULT_KEY); request.removeAttribute(RESULT_KEY); return result; }
public PortletRequestDispatcher getNamedDispatcher(ServletContext servletContext, PortletApplicationDefinition app, String name) { if (LOG.isDebugEnabled()) { LOG.debug("Named PortletRequestDispatcher requested for name: "+name+" at context: "+app.getContextPath()); } RequestDispatcher dispatcher = servletContext.getNamedDispatcher(name); if (dispatcher != null) { return new PortletRequestDispatcherImpl(dispatcher, name, true); } if (LOG.isInfoEnabled()) { LOG.info("No matching request dispatcher found for name: "+ name); } return null; }
@Override public void processAction(ActionRequest portletReq, ActionResponse portletResp) throws PortletException, IOException { portletResp.setRenderParameters(portletReq.getParameterMap()); long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); // Prereq for: V2DispatcherReqRespTests1_SPEC2_19_ForwardJSPActionRequest_getAttribute portletReq.setAttribute(ATTR_PREFIX +"V2DispatcherReqRespTests1_SPEC2_19_ForwardJSPActionRequest_getAttribute", "Value1"); // Prereq for: V2DispatcherReqRespTests1_SPEC2_19_ForwardJSPActionRequest_getAttributeNames portletReq.setAttribute(ATTR_PREFIX + "V2DispatcherReqRespTests1_SPEC2_19_ForwardJSPActionRequest_getAttributeNames", "Value1"); // Now do the actual dispatch String target = JSP_PREFIX + "DispatcherReqRespTests1_SPEC2_19_ForwardJSPActionRequest" + JSP_SUFFIX + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext() .getRequestDispatcher(target); rd.forward(portletReq, portletResp); }
@Override public void processEvent(EventRequest portletReq, EventResponse portletResp) throws PortletException, IOException { portletResp.setRenderParameters(portletReq); long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); // Prereq for: V2DispatcherReqRespTests1_SPEC2_19_ForwardJSPEventRequest_getAttribute portletReq.setAttribute(ATTR_PREFIX +"V2DispatcherReqRespTests1_SPEC2_19_ForwardJSPEventRequest_getAttribute", "Value1"); // Prereq for: V2DispatcherReqRespTests1_SPEC2_19_ForwardJSPEventRequest_getAttributeNames portletReq.setAttribute(ATTR_PREFIX + "V2DispatcherReqRespTests1_SPEC2_19_ForwardJSPEventRequest_getAttributeNames", "Value1"); // Now do the actual dispatch String target = JSP_PREFIX + "DispatcherReqRespTests1_SPEC2_19_ForwardJSPEventRequest" + JSP_SUFFIX + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext() .getRequestDispatcher(target); rd.forward(portletReq, portletResp); }
@Override public void processEvent(EventRequest portletReq, EventResponse portletResp) throws PortletException, IOException { portletResp.setRenderParameters(portletReq); long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); // Now do the actual dispatch String target = JSP_PREFIX + "DispatcherReqRespTests1_SPEC2_19_ForwardJSPEventResponse" + JSP_SUFFIX + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext() .getRequestDispatcher(target); rd.forward(portletReq, portletResp); }
@Override public void render(RenderRequest portletReq, RenderResponse portletResp) throws PortletException, IOException { long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); // Prereq for: V2DispatcherReqRespTests1_SPEC2_19_ForwardJSPRenderRequest_getAttribute portletReq.setAttribute(ATTR_PREFIX +"V2DispatcherReqRespTests1_SPEC2_19_ForwardJSPRenderRequest_getAttribute", "Value1"); // Prereq for: V2DispatcherReqRespTests1_SPEC2_19_ForwardJSPRenderRequest_getAttributeNames portletReq.setAttribute(ATTR_PREFIX + "V2DispatcherReqRespTests1_SPEC2_19_ForwardJSPRenderRequest_getAttributeNames", "Value1"); // Now do the actual dispatch String target = JSP_PREFIX + "DispatcherReqRespTests1_SPEC2_19_ForwardJSPRenderRequest" + JSP_SUFFIX + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext() .getRequestDispatcher(target); rd.forward(portletReq, portletResp); }
@Override public void processEvent(EventRequest portletReq, EventResponse portletResp) throws PortletException, IOException { portletResp.setRenderParameters(portletReq); long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); // Now do the actual dispatch String target = JSP_PREFIX + "PortletTagLibraryTests_SPEC2_26_IncludeJSPEvent" + JSP_SUFFIX + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext().getRequestDispatcher(target); rd.include(portletReq, portletResp); }
@Override public void processEvent(EventRequest portletReq, EventResponse portletResp) throws PortletException, IOException { portletResp.setRenderParameters(portletReq); long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); new StringWriter(); // Multilevel forward / include portletReq.setAttribute(ATTR_DISPATCH_ACTION, "include"); String targ = SERVLET_PREFIX + "DispatcherTests6_SPEC2_19_FwdThenIncludeServletEvent_servlet" + EXTRA_PATH + "?" + QUERY_STRING; portletReq.setAttribute(ATTR_DISPATCH_TARGET, targ); // Now do the actual dispatch String target = "/IncluderForwarderServlet" + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext().getRequestDispatcher(target); rd.forward(portletReq, portletResp); }
@Override public void serveResource(ResourceRequest portletReq, ResourceResponse portletResp) throws PortletException, IOException { long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); portletResp.getWriter(); // Multilevel forward / include portletReq.setAttribute(ATTR_DISPATCH_ACTION, "forward"); String targ = SERVLET_PREFIX + "DispatcherTests6_SPEC2_19_FwdThenForwardServletResource_servlet" + EXTRA_PATH + "?" + QUERY_STRING; portletReq.setAttribute(ATTR_DISPATCH_TARGET, targ); // Now do the actual dispatch String target = "/IncluderForwarderServlet" + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext().getRequestDispatcher(target); rd.forward(portletReq, portletResp); }
@Override public void processAction(ActionRequest portletReq, ActionResponse portletResp) throws PortletException, IOException { portletResp.setRenderParameters(portletReq.getParameterMap()); long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); new StringWriter(); // Multilevel forward / include portletReq.setAttribute(ATTR_DISPATCH_ACTION, "forward"); String targ = SERVLET_PREFIX + "DispatcherTests6_SPEC2_19_FwdThenForwardServletAction_servlet" + EXTRA_PATH + "?" + QUERY_STRING; portletReq.setAttribute(ATTR_DISPATCH_TARGET, targ); // Now do the actual dispatch String target = "/IncluderForwarderServlet" + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext().getRequestDispatcher(target); rd.forward(portletReq, portletResp); }
@Override public void serveResource(ResourceRequest portletReq, ResourceResponse portletResp) throws PortletException, IOException { long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); portletResp.getWriter(); // Multilevel forward / include portletReq.setAttribute(ATTR_DISPATCH_ACTION, "include"); String targ = SERVLET_PREFIX + "DispatcherTests6_SPEC2_19_FwdThenIncludeServletResource_servlet" + EXTRA_PATH + "?" + QUERY_STRING; portletReq.setAttribute(ATTR_DISPATCH_TARGET, targ); // Now do the actual dispatch String target = "/IncluderForwarderServlet" + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext().getRequestDispatcher(target); rd.forward(portletReq, portletResp); }
@Override public void processEvent(EventRequest portletReq, EventResponse portletResp) throws PortletException, IOException { portletResp.setRenderParameters(portletReq); long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); new StringWriter(); // Multilevel forward / include portletReq.setAttribute(ATTR_DISPATCH_ACTION, "forward"); String targ = SERVLET_PREFIX + "DispatcherTests6_SPEC2_19_FwdThenForwardServletEvent_servlet" + EXTRA_PATH + "?" + QUERY_STRING; portletReq.setAttribute(ATTR_DISPATCH_TARGET, targ); // Now do the actual dispatch String target = "/IncluderForwarderServlet" + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext().getRequestDispatcher(target); rd.forward(portletReq, portletResp); }
@Override public void processAction(ActionRequest portletReq, ActionResponse portletResp) throws PortletException, IOException { portletResp.setRenderParameters(portletReq.getParameterMap()); long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); new StringWriter(); // Multilevel forward / include portletReq.setAttribute(ATTR_DISPATCH_ACTION, "include"); String targ = SERVLET_PREFIX + "DispatcherTests6_SPEC2_19_FwdThenIncludeServletAction_servlet" + EXTRA_PATH + "?" + QUERY_STRING; portletReq.setAttribute(ATTR_DISPATCH_TARGET, targ); // Now do the actual dispatch String target = "/IncluderForwarderServlet" + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext().getRequestDispatcher(target); rd.forward(portletReq, portletResp); }
@Override public void render(RenderRequest portletReq, RenderResponse portletResp) throws PortletException, IOException { long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); portletResp.getWriter(); // Multilevel forward / include portletReq.setAttribute(ATTR_DISPATCH_ACTION, "forward"); String targ = SERVLET_PREFIX + "DispatcherTests6_SPEC2_19_FwdThenForwardServletRender_servlet" + EXTRA_PATH + "?" + QUERY_STRING; portletReq.setAttribute(ATTR_DISPATCH_TARGET, targ); // Now do the actual dispatch String target = "/IncluderForwarderServlet" + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext().getRequestDispatcher(target); rd.forward(portletReq, portletResp); }
@Override public void processEvent(EventRequest portletReq, EventResponse portletResp) throws PortletException, IOException { portletResp.setRenderParameters(portletReq); long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); TckParameters params = (TckParameters) portletReq.getEvent().getValue(); for (Parameter p : params.getParams()) { portletResp.setRenderParameter(p.getName(), p.getVals()); } // Now do the actual dispatch String target = SERVLET_PREFIX + "DispatcherTests_SPEC2_19_IncludeServletEvent_servlet" + SERVLET_SUFFIX + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext().getRequestDispatcher(target); rd.include(portletReq, portletResp); }
@Override public void processEvent(EventRequest portletReq, EventResponse portletResp) throws PortletException, IOException { portletResp.setRenderParameters(portletReq); long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); TckParameters params = (TckParameters) portletReq.getEvent().getValue(); for (Parameter p : params.getParams()) { portletResp.setRenderParameter(p.getName(), p.getVals()); } // Now do the actual dispatch String target = SERVLET_PREFIX + "DispatcherTests_SPEC2_19_ForwardServletEvent_servlet" + SERVLET_SUFFIX + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext().getRequestDispatcher(target); rd.forward(portletReq, portletResp); }
@Override public void processEvent(EventRequest portletReq, EventResponse portletResp) throws PortletException, IOException { portletResp.setRenderParameters(portletReq); long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); // Now do the actual dispatch String target = SERVLET_PREFIX + "DispatcherReqRespTests4_SPEC2_19_IncludeServletEventResponse_servlet" + SERVLET_SUFFIX + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext() .getRequestDispatcher(target); rd.include(portletReq, portletResp); }
@Override public void processEvent(EventRequest portletReq, EventResponse portletResp) throws PortletException, IOException { portletResp.setRenderParameters(portletReq); long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); // Prereq for: V2DispatcherReqRespTests4_SPEC2_19_IncludeServletEventRequest_getAttribute portletReq.setAttribute(ATTR_PREFIX +"V2DispatcherReqRespTests4_SPEC2_19_IncludeServletEventRequest_getAttribute", "Value1"); // Prereq for: V2DispatcherReqRespTests4_SPEC2_19_IncludeServletEventRequest_getAttributeNames portletReq.setAttribute(ATTR_PREFIX + "V2DispatcherReqRespTests4_SPEC2_19_IncludeServletEventRequest_getAttributeNames", "Value1"); // Now do the actual dispatch String target = SERVLET_PREFIX + "DispatcherReqRespTests4_SPEC2_19_IncludeServletEventRequest_servlet" + SERVLET_SUFFIX + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext() .getRequestDispatcher(target); rd.include(portletReq, portletResp); }
@Override public void serveResource(ResourceRequest portletReq, ResourceResponse portletResp) throws PortletException, IOException { long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); // Prereq for: V2DispatcherReqRespTests4_SPEC2_19_IncludeServletResourceRequest_getAttribute portletReq.setAttribute(ATTR_PREFIX +"V2DispatcherReqRespTests4_SPEC2_19_IncludeServletResourceRequest_getAttribute", "Value1"); // Prereq for: V2DispatcherReqRespTests4_SPEC2_19_IncludeServletResourceRequest_getAttributeNames portletReq.setAttribute(ATTR_PREFIX + "V2DispatcherReqRespTests4_SPEC2_19_IncludeServletResourceRequest_getAttributeNames", "Value1"); // Now do the actual dispatch String target = SERVLET_PREFIX + "DispatcherReqRespTests4_SPEC2_19_IncludeServletResourceRequest_servlet" + SERVLET_SUFFIX + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext() .getRequestDispatcher(target); rd.include(portletReq, portletResp); }
@Override public void render(RenderRequest portletReq, RenderResponse portletResp) throws PortletException, IOException { long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); // Prereq for: V2DispatcherReqRespTests4_SPEC2_19_IncludeServletRenderRequest_getAttribute portletReq.setAttribute(ATTR_PREFIX +"V2DispatcherReqRespTests4_SPEC2_19_IncludeServletRenderRequest_getAttribute", "Value1"); // Prereq for: V2DispatcherReqRespTests4_SPEC2_19_IncludeServletRenderRequest_getAttributeNames portletReq.setAttribute(ATTR_PREFIX + "V2DispatcherReqRespTests4_SPEC2_19_IncludeServletRenderRequest_getAttributeNames", "Value1"); // Now do the actual dispatch String target = SERVLET_PREFIX + "DispatcherReqRespTests4_SPEC2_19_IncludeServletRenderRequest_servlet" + SERVLET_SUFFIX + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext() .getRequestDispatcher(target); rd.include(portletReq, portletResp); }
@Override public void processAction(ActionRequest portletReq, ActionResponse portletResp) throws PortletException, IOException { portletResp.setRenderParameters(portletReq.getParameterMap()); long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); // Prereq for: V2DispatcherReqRespTests2_SPEC2_19_ForwardServletActionRequest_getAttribute portletReq.setAttribute(ATTR_PREFIX +"V2DispatcherReqRespTests2_SPEC2_19_ForwardServletActionRequest_getAttribute", "Value1"); // Prereq for: V2DispatcherReqRespTests2_SPEC2_19_ForwardServletActionRequest_getAttributeNames portletReq.setAttribute(ATTR_PREFIX + "V2DispatcherReqRespTests2_SPEC2_19_ForwardServletActionRequest_getAttributeNames", "Value1"); // Now do the actual dispatch String target = SERVLET_PREFIX + "DispatcherReqRespTests2_SPEC2_19_ForwardServletActionRequest_servlet" + SERVLET_SUFFIX + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext() .getRequestDispatcher(target); rd.forward(portletReq, portletResp); }
@Override public void processEvent(EventRequest portletReq, EventResponse portletResp) throws PortletException, IOException { portletResp.setRenderParameters(portletReq); long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); // Prereq for: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPEventRequest_getAttribute portletReq.setAttribute(ATTR_PREFIX +"V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPEventRequest_getAttribute", "Value1"); // Prereq for: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPEventRequest_getAttributeNames portletReq.setAttribute(ATTR_PREFIX + "V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPEventRequest_getAttributeNames", "Value1"); // Now do the actual dispatch String target = JSP_PREFIX + "DispatcherReqRespTests3_SPEC2_19_IncludeJSPEventRequest" + JSP_SUFFIX + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext() .getRequestDispatcher(target); rd.include(portletReq, portletResp); }
@Override public void processEvent(EventRequest portletReq, EventResponse portletResp) throws PortletException, IOException { portletResp.setRenderParameters(portletReq); long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); // Now do the actual dispatch String target = JSP_PREFIX + "DispatcherReqRespTests3_SPEC2_19_IncludeJSPEventResponse" + JSP_SUFFIX + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext() .getRequestDispatcher(target); rd.include(portletReq, portletResp); }
@Override public void processAction(ActionRequest portletReq, ActionResponse portletResp) throws PortletException, IOException { portletResp.setRenderParameters(portletReq.getParameterMap()); long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); // Prereq for: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPActionRequest_getAttribute portletReq.setAttribute(ATTR_PREFIX +"V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPActionRequest_getAttribute", "Value1"); // Prereq for: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPActionRequest_getAttributeNames portletReq.setAttribute(ATTR_PREFIX + "V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPActionRequest_getAttributeNames", "Value1"); // Now do the actual dispatch String target = JSP_PREFIX + "DispatcherReqRespTests3_SPEC2_19_IncludeJSPActionRequest" + JSP_SUFFIX + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext() .getRequestDispatcher(target); rd.include(portletReq, portletResp); }
@Override public void render(RenderRequest portletReq, RenderResponse portletResp) throws PortletException, IOException { long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); portletResp.getWriter(); // Multilevel forward / include portletReq.setAttribute(ATTR_DISPATCH_ACTION, "forward"); String targ = SERVLET_PREFIX + "DispatcherTests5_SPEC2_19_IncThenForwardServletRender_servlet" + EXTRA_PATH + "?" + QUERY_STRING; portletReq.setAttribute(ATTR_DISPATCH_TARGET, targ); // Now do the actual dispatch String target = SERVLET_INCFWD + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext().getRequestDispatcher(target); rd.include(portletReq, portletResp); }
@Override public void serveResource(ResourceRequest portletReq, ResourceResponse portletResp) throws PortletException, IOException { long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); portletResp.getWriter(); // Multilevel forward / include portletReq.setAttribute(ATTR_DISPATCH_ACTION, "include"); String targ = SERVLET_PREFIX + "DispatcherTests5_SPEC2_19_IncThenIncludeServletResource_servlet" + EXTRA_PATH + "?" + QUERY_STRING; portletReq.setAttribute(ATTR_DISPATCH_TARGET, targ); // Now do the actual dispatch String target = SERVLET_INCFWD + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext().getRequestDispatcher(target); rd.include(portletReq, portletResp); }
@Override public void processAction(ActionRequest portletReq, ActionResponse portletResp) throws PortletException, IOException { portletResp.setRenderParameters(portletReq.getParameterMap()); long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); new StringWriter(); // Multilevel forward / include portletReq.setAttribute(ATTR_DISPATCH_ACTION, "forward"); String targ = SERVLET_PREFIX + "DispatcherTests5_SPEC2_19_IncThenForwardServletAction_servlet" + EXTRA_PATH + "?" + QUERY_STRING; portletReq.setAttribute(ATTR_DISPATCH_TARGET, targ); // Now do the actual dispatch String target = SERVLET_INCFWD + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext().getRequestDispatcher(target); rd.include(portletReq, portletResp); }
@Override public void processEvent(EventRequest portletReq, EventResponse portletResp) throws PortletException, IOException { portletResp.setRenderParameters(portletReq); long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); new StringWriter(); // Multilevel forward / include portletReq.setAttribute(ATTR_DISPATCH_ACTION, "forward"); String targ = SERVLET_PREFIX + "DispatcherTests5_SPEC2_19_IncThenForwardServletEvent_servlet" + EXTRA_PATH + "?" + QUERY_STRING; portletReq.setAttribute(ATTR_DISPATCH_TARGET, targ); // Now do the actual dispatch String target = SERVLET_INCFWD + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext().getRequestDispatcher(target); rd.include(portletReq, portletResp); }
@Override public void processEvent(EventRequest portletReq, EventResponse portletResp) throws PortletException, IOException { portletResp.setRenderParameters(portletReq); long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); new StringWriter(); // Prereq for: V2DispatcherTests4_SPEC2_19_ForwardJSPEvent_invoke3 portletReq = new EventRequestWrapper(portletReq); portletResp = new EventResponseWrapper(portletResp); // Now do the actual dispatch String target = JSP_PREFIX + "DispatcherTests4_SPEC2_19_ForwardJSPEvent" + JSP_SUFFIX + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext().getRequestDispatcher(target); rd.forward(portletReq, portletResp); }