Examples of PortletServletRequest


Examples of org.apache.struts2.portlet.servlet.PortletServletRequest

 
  public void testShouldPassThroughRenderUrlToServletUrlRendererIfNotPortletRequest() throws Exception {
    UrlRenderer mockRenderer = EasyMock.createMock(UrlRenderer.class);
    ActionContext.getContext().put(StrutsStatics.STRUTS_PORTLET_CONTEXT, null);
    renderer.setServletRenderer(mockRenderer);
    URL url = new URL(stack, new PortletServletRequest(request, null), new PortletServletResponse(response));
    StringWriter renderOutput = new StringWriter();
    mockRenderer.renderUrl(renderOutput, url);
    EasyMock.replay(mockRenderer);
    renderer.renderUrl(renderOutput, url);
    EasyMock.verify(mockRenderer);
View Full Code Here

Examples of org.apache.struts2.portlet.servlet.PortletServletRequest

 
  public void testShouldPassThroughRenderFormUrlToServletUrlRendererIfNotPortletRequest() throws Exception {
    UrlRenderer mockRenderer = EasyMock.createMock(UrlRenderer.class);
    ActionContext.getContext().put(StrutsStatics.STRUTS_PORTLET_CONTEXT, null);
    renderer.setServletRenderer(mockRenderer);
    Form form = new Form(stack, new PortletServletRequest(request, null), new PortletServletResponse(response));
    mockRenderer.renderFormUrl(form);
    EasyMock.replay(mockRenderer);
    renderer.renderFormUrl(form);
    EasyMock.verify(mockRenderer);
  }
View Full Code Here

Examples of org.apache.struts2.portlet.servlet.PortletServletRequest

  }
 
  public void testShouldPassThroughRenderUrlToServletUrlRendererWhenPortletUrlTypeIsNone() throws Exception {
    UrlRenderer mockRenderer = EasyMock.createMock(UrlRenderer.class);
    renderer.setServletRenderer(mockRenderer);
    URL url = new URL(stack, new PortletServletRequest(request, null), new PortletServletResponse(response));
    url.setPortletUrlType("none");
    StringWriter renderOutput = new StringWriter();
    mockRenderer.renderUrl(renderOutput, url);
    EasyMock.replay(mockRenderer);
    renderer.renderUrl(renderOutput, url);
View Full Code Here

Examples of org.apache.struts2.portlet.servlet.PortletServletRequest

            Map<String, Object> sessionMap, Map<String, Object> applicationMap, PortletRequest request,
            PortletResponse response, PortletConfig portletConfig, Integer phase) throws IOException {

        // TODO Must put http request/response objects into map for use with
      HttpServletResponse dummyResponse = new PortletServletResponse(response);
      HttpServletRequest dummyRequest = new PortletServletRequest(request, getPortletContext());
      container.inject(dummyRequest);
      ServletContext dummyServletContext = new PortletServletContext(getPortletContext());
      if(EVENT_PHASE.equals(phase)) {
        dummyRequest = dispatcherUtils.wrapRequest(dummyRequest, dummyServletContext);
        if(dummyRequest instanceof MultiPartRequestWrapper) {
          // Multipart request. Request parameters are encoded in the multipart data,
          // so we need to manually add them to the parameter map.
          parameterMap.putAll(dummyRequest.getParameterMap());
        }
      }
        // ServletActionContext
        HashMap<String, Object> extraContext = new HashMap<String, Object>();
        // The dummy servlet objects. Eases reuse of existing interceptors that uses the servlet objects.
View Full Code Here

Examples of org.apache.struts2.portlet.servlet.PortletServletRequest

            } else {
               
                // Use the usual action mapper, but it is expecting an action extension
                // on the uri, so we add the default one, which should be ok as the
                // portlet is a portlet first, a servlet second
                PortletServletRequest httpRequest = new PortletServletRequest(request, getPortletContext());
                container.inject(httpRequest);
                mapping = actionMapper.getMapping(httpRequest, dispatcherUtils.getConfigurationManager());
            }
        }
       
View Full Code Here

Examples of org.apache.struts2.portlet.servlet.PortletServletRequest

        Dispatcher.setInstance(dispatcherUtils);
        String actionName = null;
        String namespace = null;
        try {
            ServletContext servletContext = new PortletServletContext(getPortletContext());
            HttpServletRequest servletRequest = new PortletServletRequest(request, getPortletContext());
            HttpServletResponse servletResponse = new PortletServletResponse(response);
            if(EVENT_PHASE.equals(phase)) {
              servletRequest = dispatcherUtils.wrapRequest(servletRequest, servletContext);
            if(servletRequest instanceof MultiPartRequestWrapper) {
              // Multipart request. Request parameters are encoded in the multipart data,
              // so we need to manually add them to the parameter map.
              parameterMap.putAll(servletRequest.getParameterMap());
            }
          }
            container.inject(servletRequest);
            ActionMapping mapping = getActionMapping(request, servletRequest);
            actionName = mapping.getName();
View Full Code Here

Examples of org.apache.struts2.portlet.servlet.PortletServletRequest

    actionInvocation.setStack(stack);

    context.setActionInvocation(actionInvocation);

    pageContext = new MockPageContext();
    pageContext.setRequest(new PortletServletRequest(renderRequest, null));
    jspWriter = new MockJspWriter();
    pageContext.setJspWriter(jspWriter);

    tag.setPageContext(pageContext);
View Full Code Here

Examples of org.apache.struts2.portlet.servlet.PortletServletRequest

            PortletResponse response, PortletConfig portletConfig, Integer phase) throws IOException {

        // TODO Must put http request/response objects into map for use with
        // ServletActionContext
        HttpServletResponse dummyResponse = new PortletServletResponse(response);
        HttpServletRequest dummyRequest = new PortletServletRequest(request, getPortletContext());
        ServletContext dummyServletContext = new PortletServletContext(getPortletContext());
        if(EVENT_PHASE.equals(phase)) {
            dummyRequest = dispatcherUtils.wrapRequest(dummyRequest, dummyServletContext);
        }
        HashMap<String,Object> extraContext = new HashMap<String,Object>();
View Full Code Here

Examples of org.apache.struts2.portlet.servlet.PortletServletRequest

            } else {
               
                // Use the usual action mapper, but it is expecting an action extension
                // on the uri, so we add the default one, which should be ok as the
                // portlet is a portlet first, a servlet second
                PortletServletRequest httpRequest = new PortletServletRequest(request, getPortletContext());
                mapping = actionMapper.getMapping(httpRequest, dispatcherUtils.getConfigurationManager());
            }
        }
       
        if (mapping == null) {
View Full Code Here

Examples of org.apache.struts2.portlet.servlet.PortletServletRequest

   * namespace is specified. (WW-1875)
   */
  public void testShouldIncludeCurrentNamespaceIfNoNamespaceSpecifiedForRenderUrl()
      throws Exception {
   
    URL url = new URL(stack, new PortletServletRequest(request, null),
        new PortletServletResponse(response));

    MockActionInvocation ai = new MockActionInvocation();
    MockActionProxy ap = new MockActionProxy();
    ap.setActionName("testAction");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.