commit | author | age
|
bc9f6a
|
1 |
/* |
U |
2 |
WebBox - Dein Server. |
|
3 |
Copyright (C) 2017 Ulrich Hilger, http://uhilger.de |
|
4 |
|
|
5 |
This program is free software: you can redistribute it and/or modify |
|
6 |
it under the terms of the GNU Affero General Public License as |
|
7 |
published by the Free Software Foundation, either version 3 of the |
|
8 |
License, or (at your option) any later version. |
|
9 |
|
|
10 |
This program is distributed in the hope that it will be useful, |
|
11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
GNU Affero General Public License for more details. |
|
14 |
|
|
15 |
You should have received a copy of the GNU Affero General Public License |
|
16 |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
17 |
*/ |
|
18 |
package de.uhilger.wbx.web; |
|
19 |
|
|
20 |
import java.util.logging.Logger; |
|
21 |
import javax.servlet.FilterChain; |
|
22 |
import javax.servlet.FilterConfig; |
|
23 |
import javax.servlet.ServletRequest; |
|
24 |
import javax.servlet.ServletResponse; |
|
25 |
|
|
26 |
/** |
|
27 |
* |
|
28 |
* @author ulrich |
|
29 |
*/ |
|
30 |
public class MyGenericFilter implements javax.servlet.Filter { |
|
31 |
private static final Logger logger = Logger.getLogger(MyGenericFilter.class.getName()); |
|
32 |
public FilterConfig filterConfig; |
|
33 |
|
|
34 |
public void doFilter(final ServletRequest request, |
|
35 |
final ServletResponse response, |
|
36 |
FilterChain chain) |
|
37 |
throws java.io.IOException, javax.servlet.ServletException { |
2ef1bb
|
38 |
response.setCharacterEncoding("UTF-8"); |
bc9f6a
|
39 |
chain.doFilter(request,response); |
U |
40 |
} |
|
41 |
|
|
42 |
public void init(final FilterConfig filterConfig) { |
|
43 |
this.filterConfig = filterConfig; |
|
44 |
logger.info(" initialisiert."); |
|
45 |
} |
|
46 |
|
|
47 |
public void destroy() { |
|
48 |
} |
|
49 |
} |