Skip to content
This repository has been archived by the owner on Dec 1, 2020. It is now read-only.

Character encoding filter for java web. Automatic detecting should UTF-8 or ISO-8859-1 should be applied to uri encoding. Default uri encoding is changed to UTF-8 since tomcat 8. It becomes very simple to configure for other encodings

zhanhb/character-encoding-filter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

character-encoding-filter

========================= This is a filter that solve GET form or POST form encoding problem.

Usage

First put the CharacterEncodingFilter.jar to the WEB-INF/lib directory then add these codes to WEB-INF/web.xml

<filter>
	<filter-name>character-encoding-filter</filter-name>
	<filter-class>com.github.zhanhb.filter.CharacterEncodingFilter</filter-class>
	<init-param>
		<description>Encoding for content and query string, default UTF-8.</description>
		<param-name>characterEncoding</param-name>
		<param-value>UTF-8</param-value>
	</init-param>
</filter>
<filter-mapping>
	<filter-name>character-encoding-filter</filter-name>
	<url-pattern>/*</url-pattern>
</filter-mapping>

or if your encoding is UTF-8 you can config your web.xml more simple.

<filter>
	<filter-name>character-encoding-filter</filter-name>
	<filter-class>com.github.zhanhb.filter.CharacterEncodingFilter</filter-class>
</filter>
<filter-mapping>
	<filter-name>character-encoding-filter</filter-name>
	<url-pattern>/*</url-pattern>
</filter-mapping>

Maven Clone:

<dependency>
  <groupId>com.github.zhanhb</groupId>
  <artifactId>character-encoding-filter</artifactId>
  <version>2.1.6.4</version>
</dependency>

About

Character encoding filter for java web. Automatic detecting should UTF-8 or ISO-8859-1 should be applied to uri encoding. Default uri encoding is changed to UTF-8 since tomcat 8. It becomes very simple to configure for other encodings

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages