Package org.apache.struts2.portlet.servlet

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


    ap.setNamespace("");
    ai.setProxy(ap);
    ai.setStack(stack);
    ctx.setActionInvocation(ai);
   
    URL url = new URL(stack, new PortletServletRequest(request, null),
        new PortletServletResponse(response));
    url.setAnchor("%{someProperty}");
   
    StringWriter renderOutput = new StringWriter();
    renderer.renderUrl(renderOutput, url.getUrlProvider());
View Full Code Here


 
  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.getUrlProvider());
    EasyMock.replay(mockRenderer);
    renderer.renderUrl(renderOutput, url.getUrlProvider());
    EasyMock.verify(mockRenderer);
View Full Code Here

 
  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

  }
 
  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.getUrlProvider());
    EasyMock.replay(mockRenderer);
    renderer.renderUrl(renderOutput, url.getUrlProvider());
View Full Code Here

        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

        Dispatcher.setInstance(dispatcherUtils);
        String actionName = null;
        String namespace;
        try {
            ServletContext servletContext = new PortletServletContext(getPortletContext());
            HttpServletRequest servletRequest = new PortletServletRequest(request, getPortletContext());
            HttpServletResponse servletResponse = createPortletServletResponse(response);
            if (phase.isAction()) {
                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

        Dispatcher.setInstance(dispatcherUtils);
        String actionName = null;
        String namespace = null;
        try {
            ServletContext servletContext = new PortletServletContext(getPortletContext());
            HttpServletRequest servletRequest = new PortletServletRequest(request, getPortletContext());
            HttpServletResponse servletResponse = createPortletServletResponse(response);
            if(ACTION_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

        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

        Dispatcher.setInstance(dispatcherUtils);
        String actionName = null;
        String namespace = null;
        try {
            ServletContext servletContext = new PortletServletContext(getPortletContext());
            HttpServletRequest servletRequest = new PortletServletRequest(request, getPortletContext());
            HttpServletResponse servletResponse = createPortletServletResponse(response);
            if(ACTION_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

        if (LOG.isDebugEnabled()) LOG.debug("serviceAction");
        Dispatcher.setInstance(dispatcherUtils);
        String actionName = null;
        String namespace;
        try {
            HttpServletRequest servletRequest = new PortletServletRequest(request, getPortletContext());
            HttpServletResponse servletResponse = createPortletServletResponse(response);
            if (phase.isAction()) {
                servletRequest = dispatcherUtils.wrapRequest(servletRequest);
                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

TOP

Related Classes of org.apache.struts2.portlet.servlet.PortletServletRequest

Copyright © 2018 www.massapicom. 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.