Package org.apache.struts2.portlet.servlet

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


            Map sessionMap, Map 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());
      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


            } 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

    public HashMap createContextMap(Map requestMap, Map parameterMap,
            Map sessionMap, Map 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());
      ServletContext dummyServletContext = new PortletServletContext(getPortletContext());
      if(EVENT_PHASE.equals(phase)) {
        dummyRequest = dispatcherUtils.wrapRequest(dummyRequest, dummyServletContext);
        if(dummyRequest instanceof MultiPartRequestWrapper) {
View Full Code Here

     * @param response The Response used for building the wrapper.
     *
     * @return The wrapper response for Servlet bound usage.
     */
    protected PortletServletResponse createPortletServletResponse( PortletResponse response ) {
        return new PortletServletResponse(response);
    }
View Full Code Here

    Map<PortletMode, String> modeMap = new HashMap<PortletMode, String>();
    modeMap.put(PortletMode.VIEW, "/view");
    ctx.put(PortletActionConstants.MODE_NAMESPACE_MAP, modeMap);
    ValueStack stack = ctx.getValueStack();
    URL url = new URL(stack, new PortletServletRequest(request, null),
        new PortletServletResponse(response));

    MockActionInvocation ai = new MockActionInvocation();
    MockActionProxy ap = new MockActionProxy();
    ap.setActionName("testAction");
    ap.setNamespace("/current_namespace");
View Full Code Here

    Map<PortletMode, String> modeMap = new HashMap<PortletMode, String>();
    modeMap.put(PortletMode.VIEW, "/view");
    ctx.put(PortletActionConstants.MODE_NAMESPACE_MAP, modeMap);
    ValueStack stack = ctx.getValueStack();
    Form form = new Form(stack, new PortletServletRequest(request, null),
        new PortletServletResponse(response));

    MockActionInvocation ai = new MockActionInvocation();
    MockActionProxy ap = new MockActionProxy();
    ap.setActionName("testAction");
    ap.setNamespace("/current_namespace");
View Full Code Here

   */
  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");
    ap.setNamespace("/current_namespace");
View Full Code Here

   */
  public void testShouldIncludeCurrentNamespaceIfNoNamespaceSpecifiedForRenderFormUrl()
      throws Exception {

    Form form = new Form(stack, new PortletServletRequest(request, null),
        new PortletServletResponse(response));

    MockActionInvocation ai = new MockActionInvocation();
    MockActionProxy ap = new MockActionProxy();
    ap.setActionName("testAction");
    ap.setNamespace("/current_namespace");
View Full Code Here

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

    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);
    assertTrue(renderOutput.toString().indexOf("#EvaluatedProperty") != -1);
View Full Code Here

TOP

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

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.