com.liferay.portal.servlet.filters.virtualhost
Class VirtualHostFilter

java.lang.Object
  extended by com.liferay.portal.kernel.servlet.BaseFilter
      extended by com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter
All Implemented Interfaces:
javax.servlet.Filter

public class VirtualHostFilter
extends com.liferay.portal.kernel.servlet.BaseFilter

View Source

This filter is used to provide virtual host functionality. However, this filter is still required even if you do not use virtual hosting because it sets the company id in the request so that subsequent calls in the thread have the company id properly set. This filter must also always be the first filter in the list of filters.

Author:
Joel Kozikowski, Brian Wing Shun Chan, Raymond Aug�

Field Summary
static java.lang.String ENCODING
           
static boolean USE_FILTER
           
 
Constructor Summary
VirtualHostFilter()
           
 
Method Summary
 void doFilter(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res, javax.servlet.FilterChain chain)
           
 void init(javax.servlet.FilterConfig config)
           
protected  boolean isValidFriendlyURL(java.lang.String friendlyURL)
           
protected  boolean isValidRequestURL(java.lang.StringBuffer requestURL)
           
 
Methods inherited from class com.liferay.portal.kernel.servlet.BaseFilter
destroy, doFilter, getFilterConfig
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USE_FILTER

public static final boolean USE_FILTER

ENCODING

public static final java.lang.String ENCODING
Constructor Detail

VirtualHostFilter

public VirtualHostFilter()
Method Detail

init

public void init(javax.servlet.FilterConfig config)
          throws javax.servlet.ServletException
Specified by:
init in interface javax.servlet.Filter
Overrides:
init in class com.liferay.portal.kernel.servlet.BaseFilter
Throws:
javax.servlet.ServletException

doFilter

public void doFilter(javax.servlet.ServletRequest req,
                     javax.servlet.ServletResponse res,
                     javax.servlet.FilterChain chain)
              throws java.io.IOException,
                     javax.servlet.ServletException
Specified by:
doFilter in interface javax.servlet.Filter
Specified by:
doFilter in class com.liferay.portal.kernel.servlet.BaseFilter
Throws:
java.io.IOException
javax.servlet.ServletException

isValidFriendlyURL

protected boolean isValidFriendlyURL(java.lang.String friendlyURL)

isValidRequestURL

protected boolean isValidRequestURL(java.lang.StringBuffer requestURL)