Rat (Release Audit Tool) results

The following document contains the results of Rat (Release Audit Tool).

*****************************************************
Summary
-------
Generated at: 2017-09-06T08:06:31+02:00
Notes: 1
Binaries: 0
Archives: 0
Standards: 57

Apache Licensed: 43
Generated Documents: 0

JavaDocs are generated and so license header is optional
Generated files do not required license headers

14 Unknown Licenses

*******************************

Unapproved licenses:

  /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/pom.xml
  /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/dispatcher/Jsr286Dispatcher.java
  /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/PortletConstants.java
  /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/PortletPhase.java
  /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/result/PortletResultHelper.java
  /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/result/PortletResultHelperJSR168.java
  /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/result/PortletResultHelperJSR286.java
  /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/servlet/PortletServletResponseJSR286.java
  /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/util/PortletUrlHelperJSR286.java
  /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/StrutsPortletTestCase.java
  /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/test/java/org/apache/struts2/components/PortletAction.java
  /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/test/java/org/apache/struts2/components/PortletUrlRendererTest.java
  /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/test/resources/log4j2.xml
  /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/test/resources/struts.xml

*******************************

Archives:

*****************************************************
  Files with Apache License headers will be marked AL
  Binary files (which do not require AL headers) will be marked B
  Compressed archives will be marked A
  Notices, licenses etc will be marked N
 !????? /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/pom.xml
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/components/PortletUrlRenderer.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/context/PortletActionContext.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/dispatcher/DirectRenderFromEventAction.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/dispatcher/DispatcherServlet.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/dispatcher/Jsr168Dispatcher.java
 !????? /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/dispatcher/Jsr286Dispatcher.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/interceptor/PortletAwareInterceptor.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/interceptor/PortletContextAware.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/interceptor/PortletPreferencesAware.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/interceptor/PortletPrincipalProxy.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/interceptor/PortletRequestAware.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/interceptor/PortletResponseAware.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/interceptor/PortletStateInterceptor.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/interceptor/ServletPortletPreferences.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/PortletApplicationMap.java
 !????? /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/PortletConstants.java
 !????? /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/PortletPhase.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/PortletRequestMap.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/PortletSessionMap.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/result/PortletActionRedirectResult.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/result/PortletResult.java
 !????? /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/result/PortletResultHelper.java
 !????? /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/result/PortletResultHelperJSR168.java
 !????? /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/result/PortletResultHelperJSR286.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/result/PortletVelocityResult.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/servlet/package.html
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/servlet/PortletHttpSession.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/servlet/PortletServletConfig.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/servlet/PortletServletContext.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/servlet/PortletServletInputStream.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/servlet/PortletServletOutputStream.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/servlet/PortletServletRequest.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/servlet/PortletServletRequestDispatcher.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/servlet/PortletServletResponse.java
 !????? /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/servlet/PortletServletResponseJSR286.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/util/PortletUrlHelper.java
 !????? /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/util/PortletUrlHelperJSR286.java
 !????? /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/StrutsPortletTestCase.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/views/freemarker/PortletFreemarkerResult.java
  N     /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/resources/NOTICE.txt
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/resources/struts-plugin.xml
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/site/site.xml
 !????? /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/test/java/org/apache/struts2/components/PortletAction.java
 !????? /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/test/java/org/apache/struts2/components/PortletUrlRendererTest.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/test/java/org/apache/struts2/portlet/context/PortletActionContextTest.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/test/java/org/apache/struts2/portlet/dispatcher/Jsr168DispatcherTest.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/test/java/org/apache/struts2/portlet/dispatcher/Jsr286DispatcherTest.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/test/java/org/apache/struts2/portlet/interceptor/PortletAwareInterceptorTest.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/test/java/org/apache/struts2/portlet/interceptor/PortletStateInterceptorTest.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/test/java/org/apache/struts2/portlet/PortletApplicationMapTest.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/test/java/org/apache/struts2/portlet/PortletRequestMapTest.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/test/java/org/apache/struts2/portlet/PortletSessionMapTest.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/test/java/org/apache/struts2/portlet/result/PortletResultTest.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/test/java/org/apache/struts2/portlet/util/PortletUrlHelperTest.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/test/java/org/apache/struts2/views/jsp/PortletUrlTagTest.java
 !????? /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/test/resources/log4j2.xml
 !????? /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/test/resources/struts.xml
 
*****************************************************
 Printing headers for files without AL header...
 
 
=======================================================================
==/Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/pom.xml
=======================================================================
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.apache.struts</groupId>
        <artifactId>struts2-plugins</artifactId>
        <version>2.5.13</version>
    </parent>

    <artifactId>struts2-portlet-plugin</artifactId>
    <packaging>jar</packaging>
    <name>Struts 2 Portlet Plugin</name>

    <dependencies>
        <!-- junit and related JARs are needed for 'compile'! -->
        <!-- Due to StrutsPortletTestCase shall be distributed to applications. -->
        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-junit-plugin</artifactId>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <optional>true</optional>
        </dependency>

        <!-- spring-core is required for javadoc of jdk8 -->
        <!-- It is indirectly referenced by struts2-junit-plugin. -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jsp-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>

        <!-- Velocity -->
        <dependency>
            <groupId>org.apache.velocity</groupId>
            <artifactId>velocity</artifactId>

=======================================================================
==/Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/dispatcher/Jsr286Dispatcher.java
=======================================================================
package org.apache.struts2.portlet.dispatcher;

import com.opensymphony.xwork2.ActionContext;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.apache.struts2.portlet.PortletPhase;
import org.apache.struts2.portlet.servlet.PortletServletResponse;
import org.apache.struts2.portlet.servlet.PortletServletResponseJSR286;

import javax.portlet.EventRequest;
import javax.portlet.EventResponse;
import javax.portlet.PortletException;
import javax.portlet.PortletRequest;
import javax.portlet.PortletResponse;
import javax.portlet.ResourceRequest;
import javax.portlet.ResourceResponse;
import java.io.IOException;

public class Jsr286Dispatcher extends Jsr168Dispatcher {

    private final static Logger LOG = LogManager.getLogger(Jsr286Dispatcher.class);


    @Override
    public void processEvent(EventRequest request, EventResponse response) throws PortletException, IOException {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Entering processEvent");
        }
        resetActionContext();
        try {
            // We'll use the event name as the "action"
            serviceAction(request, response,
                    getRequestMap(request), getParameterMap(request),
                    getSessionMap(request), getApplicationMap(),
                    portletNamespace, PortletPhase.EVENT_PHASE);
            if (LOG.isDebugEnabled()) LOG.debug("Leaving processEvent");
        } finally {
            ActionContext.setContext(null);
        }
    }

    @Override
    public void serveResource(ResourceRequest request, ResourceResponse response)
            throws PortletException, IOException {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Entering serveResource");
        }
        resetActionContext();
        try {
            serviceAction(request, response,

=======================================================================
==/Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/PortletConstants.java
=======================================================================
package org.apache.struts2.portlet;

import org.apache.struts2.ServletActionContext;
import org.apache.struts2.portlet.dispatcher.DispatcherServlet;

public class PortletConstants {
	/**
     * Default action name to use when no default action has been configured in the portlet
     * init parameters.
     */
    public static String DEFAULT_ACTION_NAME = "default";

    /**
     * Action name parameter name
     */
    public static String ACTION_PARAM = "struts.portlet.action";

    /**
     * Key for parameter holding the last executed portlet mode.
     */
    public static String MODE_PARAM = "struts.portlet.mode";

    /**
     * Key used for looking up and storing the portlet phase
     */
    public static String PHASE = "struts.portlet.phase";

    /**
     * Key used for looking up and storing the
     * {@link javax.portlet.PortletRequest}
     */
    public static String REQUEST = "struts.portlet.request";

    /**
     * Key used for looking up and storing the
     * {@link javax.portlet.PortletResponse}
     */
    public static String RESPONSE = "struts.portlet.response";

    /**
     * Key used for looking up and storing the action that was invoked in the action or event phase.
     */
    public static String EVENT_ACTION = "struts.portlet.eventAction";

    /**
     * Key used for looking up and storing the
     * {@link javax.portlet.PortletConfig}
     */
    public static String PORTLET_CONFIG = "struts.portlet.config";


=======================================================================
==/Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/PortletPhase.java
=======================================================================
package org.apache.struts2.portlet;

/**
 * Defines phases of portlet processing per the portlet specification.
 */
public enum PortletPhase {

    /**
     * Constant used for the render phase (
     * {@link javax.portlet.Portlet#render(javax.portlet.RenderRequest, javax.portlet.RenderResponse)})
     */
    RENDER_PHASE,

    /**
     * Constant used for the action phase (
     * {@link javax.portlet.Portlet#processAction(javax.portlet.ActionRequest, javax.portlet.ActionResponse)})
     */
    ACTION_PHASE,

    /**
     * Constant used for the event phase
     */
    EVENT_PHASE,

    /**
     * Constant used for the serve resource phase that was added with the 2.0 portlet specification.
     */
    SERVE_RESOURCE_PHASE;

    public boolean isRender() {
        return this.equals(RENDER_PHASE);
    }

    public boolean isAction() {
        return this.equals(ACTION_PHASE);
    }

    public boolean isEvent() {
        return this.equals(EVENT_PHASE);
    }

    public boolean isResource() {
        return this.equals(SERVE_RESOURCE_PHASE);
    }

}

=======================================================================
==/Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/result/PortletResultHelper.java
=======================================================================
package org.apache.struts2.portlet.result;

import javax.portlet.*;
import java.io.IOException;

/**
 * PortletResultHelper abstracts Portlet API result functions specific to the used API spec version.
 *
 * @author Rene Gielen
 */

public interface PortletResultHelper {

    /**
     * Set a render parameter, abstracted from the used Portlet API version
     *
     * @param response The response to set the parameter on.
     * @param key      The parameter key to set.
     * @param value    The parameter value to set.
     */
    void setRenderParameter( PortletResponse response, String key, String value );

    /**
     * Set a portlet mode, abstracted from the used Portlet API version
     *
     * @param response    The response to set the portlet mode on.
     * @param portletMode The portlet mode to set.
     *
     * @throws PortletModeException in case of errors during setting of portlet mode
     */
    void setPortletMode( PortletResponse response, PortletMode portletMode ) throws PortletModeException;

    /**
     * Call a dispatcher's include method, abstracted from the used Portlet API version.
     *
     * @param dispatcher  The dispatcher to call the include method on.
     * @param contentType The content type to set for the response.
     * @param request     The request to use for including
     * @param response    The response to use for including
     *
     * @throws IOException in case of any I/O errors
     * @throws PortletException in case of any portlet errors
     */
    void include( PortletRequestDispatcher dispatcher, String contentType, PortletRequest request,
                  PortletResponse response ) throws IOException, PortletException;
}

=======================================================================
==/Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/result/PortletResultHelperJSR168.java
=======================================================================
package org.apache.struts2.portlet.result;

import javax.portlet.*;
import java.io.IOException;

/**
 * PortletResultHelperJSR168 implements PortletResultHelper for Portlet 1.0 API (JSR168).
 *
 * @author Rene Gielen
 */
public class PortletResultHelperJSR168 implements PortletResultHelper {

    /**
     * Set a render parameter, abstracted from the used Portlet API version. This implementation assumes that the given
     * response must be a {@link javax.portlet.ActionResponse}, as JSR168 implies.
     *
     * @param response The response to set the parameter on.
     * @param key      The parameter key to set.
     * @param value    The parameter value to set.
     */
    public void setRenderParameter( PortletResponse response, String key, String value ) {
        ((ActionResponse) response).setRenderParameter(key, value);
    }

    /**
     * Set a portlet mode, abstracted from the used Portlet API version. This implementation assumes that the given
     * response must be a {@link javax.portlet.ActionResponse}, as JSR168 implies.
     *
     * @param response    The response to set the portlet mode on.
     * @param portletMode The portlet mode to set.
     */
    public void setPortletMode( PortletResponse response, PortletMode portletMode ) throws PortletModeException {
        ((ActionResponse) response).setPortletMode(portletMode);
    }

    /**
     * Call a dispatcher's include method, abstracted from the used Portlet API version. This implementation assumes
     * that the given the request must be a {@link javax.portlet.RenderRequest} and the response must be a {@link
     * javax.portlet.RenderResponse}, as JSR168 implies.
     *
     * @param dispatcher  The dispatcher to call the include method on.
     * @param contentType The content type to set for the response.
     * @param request     The request to use for including
     * @param response    The response to use for including
     */
    public void include( PortletRequestDispatcher dispatcher, String contentType, PortletRequest request,
                         PortletResponse response ) throws IOException, PortletException {
        RenderRequest req = (RenderRequest) request;
        RenderResponse res = (RenderResponse) response;
        res.setContentType(contentType);

=======================================================================
==/Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/result/PortletResultHelperJSR286.java
=======================================================================
package org.apache.struts2.portlet.result;

import javax.portlet.*;
import java.io.IOException;

/**
 * PortletResultHelperJSR286 implements PortletResultHelper for Portlet 2.0 API (JSR286).
 *
 * @author Rene Gielen
 */
public class PortletResultHelperJSR286 implements PortletResultHelper {

    /**
     * Set a render parameter, abstracted from the used Portlet API version. This implementation assumes that the given
     * response is a {@link javax.portlet.StateAwareResponse}, as JSR286 implies.
     *
     * @param response The response to set the parameter on.
     * @param key      The parameter key to set.
     * @param value    The parameter value to set.
     */
    public void setRenderParameter( PortletResponse response, String key, String value ) {
        ((StateAwareResponse) response).setRenderParameter(key, value);
    }

    /**
     * Set a portlet mode, abstracted from the used Portlet API version. This implementation assumes that the given
     * response is a {@link javax.portlet.StateAwareResponse}, as JSR286 implies.
     *
     * @param response    The response to set the portlet mode on.
     * @param portletMode The portlet mode to set.
     */
    public void setPortletMode( PortletResponse response, PortletMode portletMode ) throws PortletModeException {
        ((StateAwareResponse) response).setPortletMode(portletMode);
    }

    /**
     * Call a dispatcher's include method, abstracted from the used Portlet API version. This implementation assumes
     * that the response is a {@link javax.portlet.MimeResponse}, as JSR286 implies.
     *
     * @param dispatcher  The dispatcher to call the include method on.
     * @param contentType The content type to set for the response.
     * @param request     The request to use for including
     * @param response    The response to use for including
     */
    public void include( PortletRequestDispatcher dispatcher, String contentType, PortletRequest request,
                         PortletResponse response ) throws IOException, PortletException {
        MimeResponse res = (MimeResponse) response;
        res.setContentType(contentType);
        dispatcher.include(request, res);
    }

=======================================================================
==/Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/servlet/PortletServletResponseJSR286.java
=======================================================================
package org.apache.struts2.portlet.servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.Locale;

import javax.portlet.MimeResponse;
import javax.portlet.PortletResponse;
import javax.portlet.ResourceResponse;
import javax.servlet.ServletOutputStream;

import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;

/**
 * PortletServletResponseJSR286.
 *
 * @author Rene Gielen
 */
public class PortletServletResponseJSR286 extends PortletServletResponse {

  private static final Logger LOG = LogManager.getLogger(PortletServletResponseJSR286.class);
  
    public PortletServletResponseJSR286( PortletResponse portletResponse ) {
        super(portletResponse);
    }


    public void flushBuffer() throws IOException {
        if(portletResponse instanceof MimeResponse) {
            ((MimeResponse)portletResponse).flushBuffer();
        }
        else {
            throw new IllegalStateException("Only allowed in render or resource phase");
        }
    }

    public int getBufferSize() {
        if(portletResponse instanceof MimeResponse) {
            return ((MimeResponse)portletResponse).getBufferSize();
        }
        else {
            throw new IllegalStateException("Only allowed in render or resource phase");
        }
    }

    public String getCharacterEncoding() {
        if(portletResponse instanceof MimeResponse) {
            return ((MimeResponse)portletResponse).getCharacterEncoding();
        }

=======================================================================
==/Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/portlet/util/PortletUrlHelperJSR286.java
=======================================================================
package org.apache.struts2.portlet.util;

import org.apache.struts2.portlet.context.PortletActionContext;
import javax.portlet.PortletRequest;
import javax.portlet.MimeResponse;
import javax.portlet.BaseURL;
import javax.portlet.PortletSecurityException;
import java.util.Map;

import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;

/**
 * PortletUrlJSR286Helper.
 *
 * @author Rene Gielen
 */
public class PortletUrlHelperJSR286 extends PortletUrlHelper {

    private static final Logger LOG = LogManager.getLogger(PortletUrlHelperJSR286.class);

    protected String encodeUrl( StringBuffer sb, PortletRequest req ) {
        MimeResponse resp = (MimeResponse) PortletActionContext.getResponse();
        return resp.encodeURL(req.getContextPath() + sb.toString());
    }

    protected Object createUrl( String scheme, String type, Map<String, String[]> portletParams ) {
        MimeResponse response = (MimeResponse) PortletActionContext.getResponse();
        BaseURL url;
        if (URLTYPE_NAME_ACTION.equalsIgnoreCase(type)) {
            if (LOG.isDebugEnabled()) LOG.debug("Creating action url");
            url = response.createActionURL();
        }
        else if(URLTYPE_NAME_RESOURCE.equalsIgnoreCase(type)) {
        	if (LOG.isDebugEnabled()) LOG.debug("Creating resource url");
        	url = response.createResourceURL();
        }
        else {
            if (LOG.isDebugEnabled()) LOG.debug("Creating render url");
            url = response.createRenderURL();
        }

        url.setParameters(portletParams);

        if ("HTTPS".equalsIgnoreCase(scheme)) {
            try {
                url.setSecure(true);
            } catch ( PortletSecurityException e) {
                LOG.error("Cannot set scheme to https", e);
            }

=======================================================================
==/Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/main/java/org/apache/struts2/StrutsPortletTestCase.java
=======================================================================
package org.apache.struts2;

import com.opensymphony.xwork2.ActionContext;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.apache.struts2.portlet.PortletConstants;
import org.apache.struts2.portlet.PortletPhase;
import org.springframework.mock.web.portlet.MockPortletContext;
import org.springframework.mock.web.portlet.MockPortletRequest;
import org.springframework.mock.web.portlet.MockPortletResponse;
import org.springframework.mock.web.portlet.MockPortletSession;
import org.springframework.mock.web.portlet.MockStateAwareResponse;

import javax.portlet.PortletMode;
import java.util.HashMap;
import java.util.Map;

/**
 * Base class used to test action in portlet environment
 */
public abstract class StrutsPortletTestCase extends StrutsTestCase {

    private static final Logger LOG = LogManager.getLogger(StrutsPortletTestCase.class);

    protected MockPortletSession portletSession;
    protected MockPortletRequest portletRequest;
    protected MockPortletResponse portletResponse;
    protected MockContext portletContext;

    @Override
    protected void initActionContext(ActionContext actionContext) {
        super.initActionContext(actionContext);
        initPortletContext(actionContext);
    }

    protected void initPortletContext(ActionContext actionContext) {
        LOG.debug("Initializing mock portlet environment");
        portletContext = new MockContext();
        portletContext.setMajorVersion(getMajorVersion());
        actionContext.put(StrutsStatics.STRUTS_PORTLET_CONTEXT, portletContext);

        portletRequest = new MockPortletRequest(portletContext);
        portletResponse = new MockStateAwareResponse();
        portletSession = new MockPortletSession();
        portletRequest.setSession(portletSession);
        actionContext.setSession(createSession());
        actionContext.put(PortletConstants.REQUEST, portletRequest);
        actionContext.put(PortletConstants.RESPONSE, portletResponse);
        actionContext.put(PortletConstants.MODE_NAMESPACE_MAP, new HashMap<PortletMode, String>());
        actionContext.put(PortletConstants.PHASE, PortletPhase.EVENT_PHASE);

=======================================================================
==/Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/test/java/org/apache/struts2/components/PortletAction.java
=======================================================================
package org.apache.struts2.components;

import com.opensymphony.xwork2.Action;

public class PortletAction {

    public String execute() {
        return Action.SUCCESS;
    }

}

=======================================================================
==/Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/test/java/org/apache/struts2/components/PortletUrlRendererTest.java
=======================================================================
package org.apache.struts2.components;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionProxy;
import com.opensymphony.xwork2.util.ValueStack;
import org.apache.struts2.StrutsStatics;
import org.apache.struts2.StrutsTestCase;
import org.apache.struts2.portlet.PortletConstants;
import org.springframework.mock.web.portlet.MockMimeResponse;
import org.springframework.mock.web.portlet.MockPortletContext;
import org.springframework.mock.web.portlet.MockPortletRequest;

import javax.portlet.PortletContext;
import javax.portlet.PortletMode;

import java.io.StringWriter;
import java.io.Writer;
import java.util.Collections;

public class PortletUrlRendererTest extends StrutsTestCase {

    private ValueStack stack;

    public void setUp() throws Exception {
        super.setUp();

        ActionProxy actionProxy = getActionProxy("/portlettest/test"); // creates new empty ActionContext
        ActionContext.getContext().put(ActionContext.ACTION_INVOCATION, actionProxy.getInvocation());

        PortletContext portletCtx = new MockPortletContext();
        ActionContext.getContext().put(StrutsStatics.STRUTS_PORTLET_CONTEXT, portletCtx);
        ActionContext.getContext().put(PortletConstants.REQUEST, new MockPortletRequest(portletCtx));
        ActionContext.getContext().put(PortletConstants.RESPONSE, new MockMimeResponse());
        ActionContext.getContext().put(PortletConstants.MODE_NAMESPACE_MAP, Collections.emptyMap());

        stack = actionProxy.getInvocation().getStack();
    }

    public void testRenderUrlWithNamespace() throws Exception {
        // given
        PortletUrlRenderer renderer = new PortletUrlRenderer();
        UrlProvider component = new URL(stack, request, response).getUrlProvider();
        Writer writer = new StringWriter();

        // when
        renderer.renderUrl(writer, component);

        // then
        assertTrue("/portlettest".equals(component.getNamespace()));
    }

=======================================================================
==/Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/test/resources/log4j2.xml
=======================================================================
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
    <Appenders>
        <Console name="STDOUT" target="SYSTEM_OUT">
            <PatternLayout pattern="%d %5p (%c:%L) - %m%n"/>
        </Console>
    </Appenders>
    <Loggers>
        <Root level="info">
            <AppenderRef ref="STDOUT"/>
        </Root>
    </Loggers>
</Configuration>

=======================================================================
==/Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/portlet/src/test/resources/struts.xml
=======================================================================
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
	"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
	"http://struts.apache.org/dtds/struts-2.5.dtd">

<struts>

    <package name="test-portlet-default" namespace="/portlettest" extends="struts-portlet-default">

        <action name="test" class="org.apache.struts2.components.PortletAction">
            <result type="redirectAction">redirectAction</result>
        </action>

    </package>

</struts>