|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.eaio.j2ee.filter.HotlinkingFilter
The HotlinkingFilter checks the referer header (if present) for matches of a number of "good" referer strings. If no matches are found, the request is redirected to another URL. If the referer header is not present, the request is always accepted.
The init parameters are:
redirect
- (optional) an absolute URL that requests
with a "bad" referer should be redirected to. If not specified, the request
will be denied.referer
parameters which are the "good"
referers. To use more than one "good" referer, add a number to the
referer
parameters, like "referer_1", "referer_2" etc.Don't forget to add your local IP address to the list of "good" referers when testing locally.
Field Summary | |
static String |
PARAMETER_REDIRECT
The "redirect" parameter name. |
static String |
PARAMETER_REFERER
The "referer" parameter name. |
Constructor Summary | |
HotlinkingFilter()
Constructor for HotlinkingFilter. |
Method Summary | |
void |
destroy()
|
void |
doFilter(ServletRequest request,
ServletResponse response,
FilterChain chain)
|
FilterConfig |
getFilterConfig()
|
void |
init(FilterConfig config)
|
void |
setFilterConfig(FilterConfig config)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String PARAMETER_REFERER
public static final String PARAMETER_REDIRECT
Constructor Detail |
public HotlinkingFilter()
Method Detail |
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException
doFilter
in interface Filter
IOException
ServletException
Filter.doFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse, javax.servlet.FilterChain)
public FilterConfig getFilterConfig()
javax.servlet.Filter#getFilterConfig()
public void setFilterConfig(FilterConfig config)
javax.servlet.Filter#setFilterConfig(javax.servlet.FilterConfig)
public void init(FilterConfig config) throws ServletException
init
in interface Filter
ServletException
Filter.init(javax.servlet.FilterConfig)
public void destroy()
destroy
in interface Filter
Filter.destroy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |