public class SpringSecurityPortletFilter extends Object implements javax.portlet.filter.ActionFilter, javax.portlet.filter.RenderFilter, javax.portlet.filter.ResourceFilter
<portlet>
<filter>
<filter-name>SpringSecurityPortletFilter</filter-name>
<filter-class>com.liferay.portletmvc4spring.security.SpringSecurityPortletFilter</filter-class>
<lifecycle>ACTION_PHASE</lifecycle>
<lifecycle>RENDER_PHASE</lifecycle>
<lifecycle>RESOURCE_PHASE</lifecycle>
</filter>
<filter-mapping>
<filter-name>SpringSecurityPortletFilter</filter-name>
<portlet-name>portlet1</portlet-name>
</filter-mapping>
</portlet>
It is also necessary to specify SpringSecurityPortletConfigurer
in a component-scan or register it in the
WEB-INF/spring-context/portlet-application-context.xml descriptor. For example:
<bean id="springSecurityPortletConfigurer" class="com.liferay.portletmvc4spring.security.SpringSecurityPortletConfigurer" />
<bean id="delegatingFilterProxy" class="org.springframework.web.filter.DelegatingFilterProxy">
<property name="targetBeanName" value="springSecurityFilterChain" />
</bean>
Finally, it is necessary to specify the following in the WEB-INF/web.xml descriptor:
<filter>
<filter-name>delegatingFilterProxy</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>delegatingFilterProxy</filter-name>
<url-pattern>/WEB-INF/servlet/view</url-pattern>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
Constructor and Description |
---|
SpringSecurityPortletFilter() |
Modifier and Type | Method and Description |
---|---|
void |
destroy() |
void |
doFilter(javax.portlet.ActionRequest actionRequest,
javax.portlet.ActionResponse actionResponse,
javax.portlet.filter.FilterChain portletFilterChain) |
void |
doFilter(javax.portlet.RenderRequest renderRequest,
javax.portlet.RenderResponse renderResponse,
javax.portlet.filter.FilterChain filterChain) |
void |
doFilter(javax.portlet.ResourceRequest resourceRequest,
javax.portlet.ResourceResponse resourceResponse,
javax.portlet.filter.FilterChain portletFilterChain) |
void |
init(javax.portlet.filter.FilterConfig filterConfig) |
protected void |
renderError(ApplicationContext applicationContext,
Locale locale,
Writer writer,
String messageKey,
String defaultMessage) |
protected void |
renderError(Writer writer,
String message) |
public void destroy()
destroy
in interface javax.portlet.filter.PortletFilter
public void doFilter(javax.portlet.ActionRequest actionRequest, javax.portlet.ActionResponse actionResponse, javax.portlet.filter.FilterChain portletFilterChain) throws IOException, javax.portlet.PortletException
doFilter
in interface javax.portlet.filter.ActionFilter
IOException
javax.portlet.PortletException
public void doFilter(javax.portlet.ResourceRequest resourceRequest, javax.portlet.ResourceResponse resourceResponse, javax.portlet.filter.FilterChain portletFilterChain) throws IOException, javax.portlet.PortletException
doFilter
in interface javax.portlet.filter.ResourceFilter
IOException
javax.portlet.PortletException
public void doFilter(javax.portlet.RenderRequest renderRequest, javax.portlet.RenderResponse renderResponse, javax.portlet.filter.FilterChain filterChain) throws IOException, javax.portlet.PortletException
doFilter
in interface javax.portlet.filter.RenderFilter
IOException
javax.portlet.PortletException
public void init(javax.portlet.filter.FilterConfig filterConfig) throws javax.portlet.PortletException
init
in interface javax.portlet.filter.PortletFilter
javax.portlet.PortletException
protected void renderError(Writer writer, String message) throws IOException
IOException
protected void renderError(ApplicationContext applicationContext, Locale locale, Writer writer, String messageKey, String defaultMessage) throws IOException
IOException
Copyright © 2019 Liferay, Inc.. All rights reserved.