Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1 | espaco | 1 | /* |
| 2 | * Copyright 2009-2014 PrimeTek. |
||
| 3 | * |
||
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
||
| 5 | * you may not use this file except in compliance with the License. |
||
| 6 | * You may obtain a copy of the License at |
||
| 7 | * |
||
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
||
| 9 | * |
||
| 10 | * Unless required by applicable law or agreed to in writing, software |
||
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
||
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||
| 13 | * See the License for the specific language governing permissions and |
||
| 14 | * limitations under the License. |
||
| 15 | */ |
||
| 16 | package br.com.ec.filter; |
||
| 17 | |||
| 18 | import java.io.IOException; |
||
| 19 | |||
| 20 | import javax.servlet.Filter; |
||
| 21 | import javax.servlet.FilterChain; |
||
| 22 | import javax.servlet.FilterConfig; |
||
| 23 | import javax.servlet.ServletException; |
||
| 24 | import javax.servlet.ServletRequest; |
||
| 25 | import javax.servlet.ServletResponse; |
||
| 26 | |||
| 27 | public class CharacterEncodingFilter implements Filter { |
||
| 28 | |||
| 29 | public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException { |
||
| 30 | req.setCharacterEncoding("UTF-8"); |
||
| 31 | resp.setCharacterEncoding("UTF-8"); |
||
| 32 | chain.doFilter(req, resp); |
||
| 33 | } |
||
| 34 | |||
| 35 | public void init(FilterConfig filterConfig) throws ServletException { |
||
| 36 | |||
| 37 | } |
||
| 38 | |||
| 39 | public void destroy() { |
||
| 40 | |||
| 41 | } |
||
| 42 | |||
| 43 | } |