Get
private Customer encoding(Customer criteria) throws UnsupportedEncodingException {
String cname = criteria.getCname();
String gender = criteria.getGender();
String cellphone = criteria.getCellphone();
String email = criteria.getEmail();
if(cname != null && !cname.trim().isEmpty()) {
cname = new String(cname.getBytes("ISO-8859-1"), "utf-8");
criteria.setCname(cname);
}
if(gender != null && !gender.trim().isEmpty()) {
gender = new String(gender.getBytes("ISO-8859-1"), "utf-8");
criteria.setGender(gender);
}
if(cellphone != null && !cellphone.trim().isEmpty()) {
cellphone = new String(cellphone.getBytes("ISO-8859-1"), "utf-8");
criteria.setCellphone(cellphone);
}
if(email != null && !email.trim().isEmpty()) {
email = new String(email.getBytes("ISO-8859-1"), "utf-8");
criteria.setEmail(email);
}
return criteria;
}
Post
response.setContentType("text/html;charset=UTF-8");
request.setCharacterEncoding("UTF-8");