크롬이나 파폭은 문제가 없었는데
익스플로러에서 url로 한글 파라메터를 넘기니 한글이 깨진다.
역시 웹 개발은 익스플로러부터 해야 나중에 오류발견해서 고치지 않아도 되는것같다.
ie를 주깁시다 ie는 나의원쑤
해결 방법은,
tomcat을 사용하였으니 tomcat을 예로 들면,
connector 부분에 해당 구문을 추가한다.
useBodyEncodingForURI = “true”
그럼,
< Connector connectionTimeout = "20000" port = "8080" protocol = "HTTP/1.1" redirectPort = "8443" useBodyEncodingForURI = "true" />
이런식이 된다.
서버를 재기동하고,
jsp 단에서 파라메터를 받아올때 해당 루틴을 타게 만든다.
// check IE url encoding
String ua = request.getHeader("User-Agent");
boolean isMSIE = ( ua != null && ua.indexOf("MSIE") != -1);
if(isMSIE)
{
request.setCharacterEncoding("KSC5601");
String getAddress = request.getParameter("address");
request.setCharacterEncoding("UTF-8"); //setting utf-8
}
else
{
request.setCharacterEncoding("UTF-8");
}
저 파라메터가 한글로 들어오는것 말고는 utf-8로 수행해야 해서 다시 utf-8로 바꿔주었다.