ch.uzh.ifi.attempto.echocomp
Class HeaderControlFilter
java.lang.Object
ch.uzh.ifi.attempto.echocomp.HeaderControlFilter
- All Implemented Interfaces:
- javax.servlet.Filter
public class HeaderControlFilter
- extends java.lang.Object
- implements javax.servlet.Filter
This filter is a workaround for the problem that Firefox 3.0.0 to 3.0.4 somehow sends wrong
XML headers to the server.
See the discussion in this thread
of the Echo forum.
This code is inspired by the workaround proposed by the user "Nadir".
In order to apply this filter, the following lines have to be added to web.xml:
<filter>
<filter-name>headercontrol</filter-name>
<filter-class>ch.uzh.ifi.attempto.echocomp.HeaderControlFilter</filter-class>
<init-param>
<param-name>request.reencoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>headercontrol</filter-name>
<url-pattern>*</url-pattern>
</filter-mapping>
Field Summary |
protected java.lang.String |
reencParam
|
Method Summary |
void |
destroy()
|
void |
doFilter(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse resp,
javax.servlet.FilterChain chain)
|
void |
init(javax.servlet.FilterConfig filterConfig)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
reencParam
protected java.lang.String reencParam
HeaderControlFilter
public HeaderControlFilter()
init
public void init(javax.servlet.FilterConfig filterConfig)
throws javax.servlet.ServletException
- Specified by:
init
in interface javax.servlet.Filter
- Throws:
javax.servlet.ServletException
destroy
public void destroy()
- Specified by:
destroy
in interface javax.servlet.Filter
doFilter
public void doFilter(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse resp,
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
Copyright 2008-2009, Attempto Group, University of Zurich (see http://attempto.ifi.uzh.ch)