<자바 스크립트>
넘기는 값 : encodeURIComponent(넣을 값)
<자바>
받는 값 : URLDecoder.decode(request.getString("받는 값"), "UTF-8")
예시)
javascript--
jQuery.ajax({
type : 'POST',
dataType: 'json',
url : url,
async : false,
data : name: encodeURIComponent('테스트'),
success : function(data){
ajaxResult = data.resultFlag;
},
error : function(xhr, ajaxOptions, thrownError){
alert('status: '+xhr.status+'\n error: '+thrownError);
}
});
JAVA--
String name = URLDecoder.decode(request.getString("name"), "UTF-8");