0,0 → 1,36 |
package ak.simplechat; |
|
import java.io.IOException; |
import javax.servlet.Filter; |
import javax.servlet.FilterChain; |
import javax.servlet.FilterConfig; |
import javax.servlet.ServletException; |
import javax.servlet.ServletRequest; |
import javax.servlet.ServletResponse; |
|
public class EncodingFilter implements Filter |
{ |
public static final String ENCODING = "UTF-8"; |
|
private FilterConfig filterConfig; |
|
public void init(FilterConfig filterConfig) |
throws ServletException |
{ |
this.filterConfig = filterConfig; |
} |
|
public void doFilter(ServletRequest request, ServletResponse response, |
FilterChain chain) |
throws IOException, ServletException |
{ |
if(request.getCharacterEncoding() == null) |
request.setCharacterEncoding(ENCODING); |
|
chain.doFilter(request, response); |
} |
|
public void destroy() |
{ |
} |
} |
Property changes: |
Added: svn:keywords |
+LastChangedDate LastChangedRevision LastChangedBy HeadURL Id |
\ No newline at end of property |