Programming/JSP

한글 인코딩시 주의점.

커널제로 2011. 5. 23. 23:11
 Page directive: illegal to have multiple occurrences of contentType with different values (old: text/html; charset=EUC-KR, new: text/html; charset=euc-kr)
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)

이 에러는 스크립트 릿이랑 html 메타부분의 인코딩이 다른경우(대소문자, 공백도) 나오는 에러다. 

이클립스에서 jsp파일을 만들면 인코딩 문자가 자동으로 삽입되는데
<%@ page contentType="text/html; charset=euc-kr"%>

이부분의 euc-kr의 대소문자나 띄어쓰기가 다르면 오류가 난다.