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

java.lang.Object
  extended bycom.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter
All Implemented Interfaces:
javax.servlet.Filter

public class VirtualHostFilter
extends java.lang.Object
implements javax.servlet.Filter

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

Field Summary
static java.lang.String ENCODING
           
static boolean USE_FILTER
           
 
Constructor Summary
VirtualHostFilter()
           
 
Method Summary
 void destroy()
           
 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 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
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
Throws:
java.io.IOException
javax.servlet.ServletException

destroy

public void destroy()
Specified by:
destroy in interface javax.servlet.Filter

isValidFriendlyURL

protected boolean isValidFriendlyURL(java.lang.String friendlyURL)

isValidRequestURL

protected boolean isValidRequestURL(java.lang.StringBuffer requestURL)