Last active
December 21, 2015 02:59
-
-
Save chocotan/6239242 to your computer and use it in GitHub Desktop.
Jersey+Grizzly+Spring
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.loli.askloli.test; | |
import java.util.Map; | |
import java.util.Map.Entry; | |
import java.util.TreeMap; | |
import javax.ws.rs.core.MediaType; | |
import javax.ws.rs.core.MultivaluedMap; | |
import org.codehaus.jackson.map.ObjectMapper; | |
import org.junit.Before; | |
import org.junit.BeforeClass; | |
import org.springframework.web.context.ContextLoaderListener; | |
import org.springframework.web.context.request.RequestContextListener; | |
import com.sun.jersey.api.client.WebResource; | |
import com.sun.jersey.client.apache4.ApacheHttpClient4; | |
import com.sun.jersey.client.apache4.config.DefaultApacheHttpClient4Config; | |
import com.sun.jersey.core.util.MultivaluedMapImpl; | |
import com.sun.jersey.spi.spring.container.servlet.SpringServlet; | |
import com.sun.jersey.test.framework.AppDescriptor; | |
import com.sun.jersey.test.framework.JerseyTest; | |
import com.sun.jersey.test.framework.WebAppDescriptor; | |
public class JerseyBaseTest extends JerseyTest { | |
protected static ApacheHttpClient4 client; | |
protected static DefaultApacheHttpClient4Config config; | |
protected String output; | |
protected final static String GET = "GET"; | |
protected final static String POST = "POST"; | |
protected WebResource webResource; | |
protected static Map<String, String> paramMap; | |
protected String host = "http://localhost:9998"; | |
protected static ObjectMapper mapper; | |
@Override | |
protected AppDescriptor configure() { | |
return new WebAppDescriptor.Builder("io.loli.askloli.controller") | |
.contextParam("contextConfigLocation", | |
"classpath:applicationContext.xml") | |
.contextPath("/") | |
.servletClass(SpringServlet.class) | |
.initParam("com.sun.jersey.api.json.POJOMappingFeature", "true") | |
.contextListenerClass(ContextLoaderListener.class) | |
.requestListenerClass(RequestContextListener.class).build(); | |
} | |
@BeforeClass | |
public static void beforeClass() { | |
paramMap = new TreeMap<String, String>(); | |
//加上后反而cookie反而会失效 | |
// config = new DefaultApacheHttpClient4Config(); | |
// config.getProperties().put( | |
// "com.sun.jersey.impl.client.httpclient.handleCookies", true); | |
paramMap = new TreeMap<String, String>(); | |
mapper = new ObjectMapper(); | |
} | |
@Before | |
public void setUp() { | |
client = ApacheHttpClient4.create(); | |
} | |
protected void connect(String url, String method, String mediaType, | |
Map<String, String> paramMap) { | |
url = host + url; | |
webResource = client.resource(url); | |
if (method.equals(GET)) { | |
output = webResource.accept(mediaType).get(String.class); | |
} else { | |
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl(); | |
for (Entry<String, String> entry : paramMap.entrySet()) { | |
queryParams.add(entry.getKey(), entry.getValue()); | |
} | |
output = webResource | |
.type(MediaType.APPLICATION_FORM_URLENCODED_TYPE) | |
.accept(mediaType).post(String.class, queryParams); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>io.loli</groupId> | |
<artifactId>askloli</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<packaging>jar</packaging> | |
<name>askloli</name> | |
<description>一个自定义问卷调查的webapp</description> | |
<properties> | |
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | |
<spring.version>3.2.2.RELEASE</spring.version> | |
<java.version>1.7</java.version> | |
<junit.version>4.11</junit.version> | |
<openjpa.version>2.2.2</openjpa.version> | |
<dbcp.version>20030825.184428</dbcp.version> | |
<pool.version>20030825.183949</pool.version> | |
<mysql-driver.version>5.1.25</mysql-driver.version> | |
<log4j.version>1.2.15</log4j.version> | |
<validation.version>1.1.0.Final</validation.version> | |
<hibernate-validator.version>5.0.1.Final</hibernate-validator.version> | |
<jersey.version>2.2-SNAPSHOT</jersey.version> | |
</properties> | |
<repositories> | |
<repository> | |
<id>snapshot-repository.java.net</id> | |
<name>Java.net Snapshot Repository for Maven</name> | |
<url>https://maven.java.net/content/repositories/snapshots/</url> | |
<layout>default</layout> | |
</repository> | |
<repository> | |
<id>glassfish.dev.java.net</id> | |
<url>http://download.java.net/maven/glassfish</url> | |
<layout>default</layout> | |
</repository> | |
</repositories> | |
<dependencies> | |
<!-- Spring Dependencies --> | |
<dependency> | |
<groupId>org.springframework</groupId> | |
<artifactId>spring-context</artifactId> | |
<version>${spring.version}</version> | |
<!-- <exclusions> Exclude Commons Logging in favor of SLF4j <exclusion> | |
<groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> | |
</exclusion> </exclusions> --> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework</groupId> | |
<artifactId>spring-orm</artifactId> | |
<version>${spring.version}</version> | |
<type>jar</type> | |
<scope>compile</scope> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework</groupId> | |
<artifactId>spring-web</artifactId> | |
<version>${spring.version}</version> | |
<type>jar</type> | |
<scope>compile</scope> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework</groupId> | |
<artifactId>spring-test</artifactId> | |
<version>${spring.version}</version> | |
<type>jar</type> | |
<scope>test</scope> | |
</dependency> | |
<!-- DB Dependencies --> | |
<dependency> | |
<groupId>commons-dbcp</groupId> | |
<artifactId>commons-dbcp</artifactId> | |
<version>${dbcp.version}</version> | |
<type>jar</type> | |
<scope>compile</scope> | |
</dependency> | |
<dependency> | |
<groupId>commons-pool</groupId> | |
<artifactId>commons-pool</artifactId> | |
<version>${pool.version}</version> | |
<type>jar</type> | |
<scope>compile</scope> | |
</dependency> | |
<!-- View Dependencies --> | |
<dependency> | |
<groupId>javax.servlet</groupId> | |
<artifactId>javax.servlet-api</artifactId> | |
<version>3.1.0</version> | |
<scope>provided</scope> | |
</dependency> | |
<dependency> | |
<groupId>com.sun.jersey</groupId> | |
<artifactId>jersey-json</artifactId> | |
<version>1.17.1</version> | |
</dependency> | |
<dependency> | |
<groupId>com.sun.jersey</groupId> | |
<artifactId>jersey-grizzly2-servlet</artifactId> | |
<version>1.17.1</version> | |
</dependency> | |
<dependency> | |
<groupId>com.sun.jersey</groupId> | |
<artifactId>jersey-grizzly2</artifactId> | |
<version>1.17.1</version> | |
</dependency> | |
<dependency> | |
<groupId>com.sun.jersey</groupId> | |
<artifactId>jersey-servlet</artifactId> | |
<version>1.17.1</version> | |
</dependency> | |
<dependency> | |
<groupId>com.sun.jersey</groupId> | |
<artifactId>jersey-server</artifactId> | |
<version>1.17.1</version> | |
</dependency> | |
<dependency> | |
<groupId>com.sun.jersey</groupId> | |
<artifactId>jersey-core</artifactId> | |
<version>1.17.1</version> | |
</dependency> | |
<dependency> | |
<groupId>com.sun.jersey</groupId> | |
<artifactId>jersey-client</artifactId> | |
<version>1.17.1</version> | |
</dependency> | |
<dependency> | |
<groupId>com.sun.jersey.contribs</groupId> | |
<artifactId>jersey-spring</artifactId> | |
<version>1.17.1</version> | |
<exclusions> | |
<exclusion> | |
<groupId>org.springframework</groupId> | |
<artifactId>spring</artifactId> | |
</exclusion> | |
<exclusion> | |
<groupId>org.springframework</groupId> | |
<artifactId>spring-core</artifactId> | |
</exclusion> | |
<exclusion> | |
<groupId>org.springframework</groupId> | |
<artifactId>spring-web</artifactId> | |
</exclusion> | |
<exclusion> | |
<groupId>org.springframework</groupId> | |
<artifactId>spring-beans</artifactId> | |
</exclusion> | |
<exclusion> | |
<groupId>org.springframework</groupId> | |
<artifactId>spring-context</artifactId> | |
</exclusion> | |
<exclusion> | |
<groupId>org.springframework</groupId> | |
<artifactId>spring-aop</artifactId> | |
</exclusion> | |
<exclusion> | |
<groupId>org.springframework</groupId> | |
<artifactId>spring-asm</artifactId> | |
</exclusion> | |
</exclusions> | |
</dependency> | |
<dependency> | |
<groupId>javax.ws.rs</groupId> | |
<artifactId>jsr311-api</artifactId> | |
<version>1.1-ea</version> | |
<scope>provided</scope> | |
</dependency> | |
<!-- Bean Validation Dependencies --> | |
<dependency> | |
<groupId>javax.validation</groupId> | |
<artifactId>validation-api</artifactId> | |
<version>${validation.version}</version> | |
<scope>compile</scope> | |
</dependency> | |
<!-- JPA Persistence Dependencies --> | |
<dependency> | |
<groupId>org.apache.openjpa</groupId> | |
<artifactId>openjpa</artifactId> | |
<version>${openjpa.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>mysql</groupId> | |
<artifactId>mysql-connector-java</artifactId> | |
<version>${mysql-driver.version}</version> | |
</dependency> | |
<!-- JSR-330 --> | |
<dependency> | |
<groupId>javax.inject</groupId> | |
<artifactId>javax.inject</artifactId> | |
<version>1</version> | |
</dependency> | |
<dependency> | |
<groupId>junit</groupId> | |
<artifactId>junit</artifactId> | |
<version>4.11</version> | |
<scope>test</scope> | |
</dependency> | |
<dependency> | |
<groupId>com.sun.jersey.jersey-test-framework</groupId> | |
<artifactId>jersey-test-framework-grizzly2</artifactId> | |
<version>1.17.1</version> | |
<scope>test</scope> | |
</dependency> | |
<dependency> | |
<groupId>org.glassfish.grizzly</groupId> | |
<artifactId>grizzly-framework</artifactId> | |
<version>2.3.5</version> | |
</dependency> | |
<dependency> | |
<groupId>org.glassfish.grizzly</groupId> | |
<artifactId>grizzly-http</artifactId> | |
<version>2.3.5</version> | |
</dependency> | |
<dependency> | |
<groupId>org.glassfish.grizzly</groupId> | |
<artifactId>grizzly-http-server</artifactId> | |
<version>2.3.5</version> | |
</dependency> | |
<dependency> | |
<groupId>org.glassfish.grizzly</groupId> | |
<artifactId>grizzly-http-servlet</artifactId> | |
<version>2.3.5</version> | |
</dependency> | |
<dependency> | |
<groupId>org.glassfish.grizzly</groupId> | |
<artifactId>grizzly-http-servlet-extras</artifactId> | |
<version>2.3.5</version> | |
</dependency> | |
<dependency> | |
<groupId>com.sun.jersey.contribs</groupId> | |
<artifactId>jersey-apache-client4</artifactId> | |
<version>1.17.1</version> | |
<scope>test</scope> | |
</dependency> | |
</dependencies> | |
<build> | |
<finalName>io.loli.askloli</finalName> | |
<plugins> | |
<plugin> | |
<groupId>org.codehaus.mojo</groupId> | |
<artifactId>exec-maven-plugin</artifactId> | |
<version>1.1</version> | |
<configuration> | |
<mainClass>io.loli.askloli.start.Start</mainClass> | |
</configuration> | |
<executions> | |
<execution> | |
<id>my-execution</id> | |
<phase>package</phase> | |
<goals> | |
<goal>java</goal> | |
</goals> | |
</execution> | |
</executions> | |
</plugin> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-eclipse-plugin</artifactId> | |
<version>2.8</version> | |
<configuration> | |
<wtpversion>2.0</wtpversion> | |
<downloadSources>true</downloadSources> | |
<downloadJavadocs>true</downloadJavadocs> | |
</configuration> | |
</plugin> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-compiler-plugin</artifactId> | |
<version>2.3.2</version> | |
<configuration> | |
<source>1.7</source> | |
<target>1.7</target> | |
</configuration> | |
</plugin> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-source-plugin</artifactId> | |
<version>2.2.1</version> | |
<executions> | |
<execution> | |
<id>attach-sources</id> | |
<goals> | |
<goal>jar</goal> | |
</goals> | |
</execution> | |
</executions> | |
</plugin> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-javadoc-plugin</artifactId> | |
<version>2.9.1</version> | |
<executions> | |
<execution> | |
<id>attach-javadocs</id> | |
<goals> | |
<goal>jar</goal> | |
</goals> | |
</execution> | |
</executions> | |
</plugin> | |
</plugins> | |
</build> | |
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.loli.askloli.start; | |
import java.io.IOException; | |
import org.glassfish.grizzly.http.server.HttpServer; | |
import org.glassfish.grizzly.http.server.NetworkListener; | |
import org.glassfish.grizzly.servlet.ServletRegistration; | |
import org.glassfish.grizzly.servlet.WebappContext; | |
import com.sun.jersey.spi.spring.container.servlet.SpringServlet; | |
public class Start { | |
private HttpServer server; | |
public void start() throws IOException{ | |
server = new HttpServer(); | |
NetworkListener listener = new NetworkListener("grizzly2", "localhost", | |
8080); | |
server.addListener(listener); | |
WebappContext ctx = new WebappContext("ctx", ""); | |
final ServletRegistration reg = ctx.addServlet("spring", | |
new SpringServlet()); | |
reg.addMapping("/*"); | |
reg.setInitParameter("com.sun.jersey.config.property.packages", | |
"io.loli.askloli.controller"); | |
//不加这个则会在每个name前面加上@ | |
reg.setInitParameter("com.sun.jersey.api.json.POJOMappingFeature", "true"); | |
ctx.addContextInitParameter("contextConfigLocation", | |
"classpath:applicationContext.xml"); | |
ctx.addListener("org.springframework.web.context.ContextLoaderListener"); | |
ctx.addListener("org.springframework.web.context.request.RequestContextListener"); | |
ctx.deploy(server); | |
server.start(); | |
System.in.read(); | |
} | |
public static void main(String[] args) throws IOException { | |
new Start().start(); | |
} | |
public void stop(){ | |
server.shutdown(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.loli.askloli.controller; | |
import static org.hamcrest.CoreMatchers.not; | |
import static org.junit.Assert.assertEquals; | |
import static org.junit.Assert.assertNull; | |
import static org.junit.Assert.assertThat; | |
import io.loli.askloli.entity.User; | |
import io.loli.askloli.test.JerseyBaseTest; | |
import java.io.IOException; | |
import java.util.Date; | |
import javax.ws.rs.core.MediaType; | |
import org.codehaus.jackson.JsonParseException; | |
import org.codehaus.jackson.map.JsonMappingException; | |
import org.junit.Test; | |
public class UserControllerTest extends JerseyBaseTest { | |
@Test | |
public void testRegist() throws JsonParseException, JsonMappingException, | |
IOException { | |
String username1 = "chocotan" + new Date().hashCode(); | |
String email1 = "uzumakitenye@gmail.com" + new Date().hashCode(); | |
paramMap.put("username", username1); | |
paramMap.put("password", "password"); | |
paramMap.put("email", email1); | |
this.connect("/user/regist", POST, MediaType.APPLICATION_JSON, paramMap); | |
User user1 = mapper.readValue(output, User.class); | |
assertThat(user1.getId(), not(0)); | |
this.connect("/user/regist", POST, MediaType.APPLICATION_JSON, paramMap); | |
User user2 = mapper.readValue(output, User.class); | |
assertEquals(0, user2.getId()); | |
} | |
@Test | |
public void testCanRegist() { | |
String username1 = "chocotan" + new Date().hashCode(); | |
String email1 = "uzumakitenye@gmail.com" + new Date().hashCode(); | |
paramMap.put("username", username1); | |
paramMap.put("password", "password"); | |
paramMap.put("email", email1); | |
this.connect("/user/regist", POST, MediaType.APPLICATION_JSON, paramMap); | |
// 用户名一样 不能注册 | |
paramMap.clear(); | |
paramMap.put("name", username1); | |
paramMap.put("type", "username"); | |
this.connect("/user/exists", POST, MediaType.TEXT_PLAIN, paramMap); | |
assertEquals("failed", output); | |
// 邮箱一样 不能注册 | |
paramMap.clear(); | |
paramMap.put("name", email1); | |
paramMap.put("type", "email"); | |
this.connect("/user/exists", POST, MediaType.TEXT_PLAIN, paramMap); | |
assertEquals("failed", output); | |
// 用户名不一样 能注册 | |
paramMap.clear(); | |
paramMap.put("name", username1 + new Date().hashCode()); | |
paramMap.put("type", "username"); | |
this.connect("/user/exists", POST, MediaType.TEXT_PLAIN, paramMap); | |
assertEquals("success", output); | |
} | |
@Test | |
public void testLogin() throws JsonParseException, JsonMappingException, | |
IOException { | |
String username1 = "chocotan" + new Date().hashCode(); | |
String email1 = "uzumakitenye@gmail.com" + new Date().hashCode(); | |
paramMap.put("username", username1); | |
paramMap.put("password", "password"); | |
paramMap.put("email", email1); | |
this.connect("/user/regist", POST, MediaType.APPLICATION_JSON, paramMap); | |
// 用户名密码正确 成功登陆 | |
paramMap.clear(); | |
paramMap.put("username", username1); | |
paramMap.put("password", "password"); | |
this.connect("/user/login", POST, MediaType.APPLICATION_JSON, paramMap); | |
User user1 = mapper.readValue(output, User.class); | |
assertEquals(username1, user1.getUsername()); | |
// 用户名错误 登录失败 | |
paramMap.clear(); | |
paramMap.put("username", username1 + new Date().hashCode()); | |
paramMap.put("password", "password"); | |
this.connect("/user/login", POST, MediaType.APPLICATION_JSON, paramMap); | |
User user2 = mapper.readValue(output, User.class); | |
assertEquals(0, user2.getId()); | |
assertNull(user2.getUsername()); | |
} | |
@Test | |
public void testCheckLogin() throws JsonParseException, | |
JsonMappingException, IOException { | |
String username1 = "chocotan" + new Date().hashCode(); | |
String email1 = "uzumakitenye@gmail.com" + new Date().hashCode(); | |
paramMap.put("username", username1); | |
paramMap.put("password", "password"); | |
paramMap.put("email", email1); | |
this.connect("/user/regist", POST, MediaType.APPLICATION_JSON, paramMap); | |
// 用户名密码错误 登录失败 | |
paramMap.clear(); | |
paramMap.put("username", username1 + new Date().hashCode()); | |
paramMap.put("password", "password"); | |
this.connect("/user/login", POST, MediaType.APPLICATION_JSON, paramMap); | |
// 判断是否登陆 | |
paramMap.clear(); | |
this.connect("/user/loggedIn", POST, MediaType.APPLICATION_JSON, | |
paramMap); | |
User user = mapper.readValue(output, User.class); | |
assertEquals(0, user.getId()); | |
// 成功登陆 | |
paramMap.clear(); | |
paramMap.put("username", username1); | |
paramMap.put("password", "password"); | |
this.connect("/user/login", POST, MediaType.APPLICATION_JSON, paramMap); | |
// 判断是否登录 | |
paramMap.clear(); | |
this.connect("/user/loggedIn", POST, MediaType.APPLICATION_JSON, | |
paramMap); | |
User user2 = mapper.readValue(output, User.class); | |
assertEquals(username1, user2.getUsername()); | |
} | |
@Test | |
public void testCheckLogOut() throws JsonParseException, | |
JsonMappingException, IOException { | |
// 未登录 | |
paramMap.clear(); | |
this.connect("/user/logout", GET, MediaType.APPLICATION_JSON, paramMap); | |
assertEquals("not_login", output); | |
// 注册 | |
String username1 = "chocotan" + new Date().hashCode(); | |
String email1 = "uzumakitenye@gmail.com" + new Date().hashCode(); | |
paramMap.put("username", username1); | |
paramMap.put("password", "password"); | |
paramMap.put("email", email1); | |
this.connect("/user/regist", POST, MediaType.APPLICATION_JSON, paramMap); | |
// 登陆 | |
paramMap.clear(); | |
paramMap.put("username", username1); | |
paramMap.put("password", "password"); | |
this.connect("/user/login", POST, MediaType.APPLICATION_JSON, paramMap); | |
User user1 = mapper.readValue(output, User.class); | |
assertEquals(username1, user1.getUsername()); | |
// 登出 | |
paramMap.clear(); | |
this.connect("/user/logout", GET, MediaType.APPLICATION_JSON, paramMap); | |
assertEquals("logout_success", output); | |
// 判断是否登录 | |
paramMap.clear(); | |
this.connect("/user/loggedIn", POST, MediaType.APPLICATION_JSON, | |
paramMap); | |
User user2 = mapper.readValue(output, User.class); | |
assertEquals(0, user2.getId()); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns:web="http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" | |
version="3.1"> | |
<context-param> | |
<param-name>contextConfigLocation</param-name> | |
<param-value>/WEB-INF/classes/applicationContext.xml</param-value> | |
</context-param> | |
<listener> | |
<listener-class>org.springframework.web.context.ContextLoaderListener | |
</listener-class> | |
</listener> | |
<listener> | |
<listener-class>org.springframework.web.context.request.RequestContextListener | |
</listener-class> | |
</listener> | |
<servlet> | |
<servlet-name>jersey-serlvet</servlet-name> | |
<servlet-class> | |
com.sun.jersey.spi.spring.container.servlet.SpringServlet | |
</servlet-class> | |
<init-param> | |
<param-name> | |
com.sun.jersey.config.property.packages | |
</param-name> | |
<param-value>io.loli.askloli</param-value> | |
</init-param> | |
<load-on-startup>1</load-on-startup> | |
</servlet> | |
<servlet-mapping> | |
<servlet-name>jersey-serlvet</servlet-name> | |
<url-pattern>/rest/*</url-pattern> | |
</servlet-mapping> | |
<filter> | |
<filter-name>characterEncodingFilter</filter-name> | |
<filter-class>org.springframework.web.filter.CharacterEncodingFilter | |
</filter-class> | |
<init-param> | |
<param-name>encoding</param-name> | |
<param-value>UTF-8</param-value> | |
</init-param> | |
<init-param> | |
<param-name>forceEncoding</param-name> | |
<param-value>true</param-value> | |
</init-param> | |
</filter> | |
</web-app> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment