인코딩은 jsp, 서버, spring 단계마다 각각 인코딩 설정해준대로 돌아간다.
2가지 인코딩 문제를 겪음.
1.Spring에서 수정하고, 수정사항을 보여주는데 인코딩이 깨짐.
이 때 javascript와 spring 상에서 잘 뿌려주는지 확인했는데 response 단에 문제가 있었음.
해결방법은
@RequestMapping(value = "/addpresident", method = RequestMethod.POST, produces = "text/html; charset=utf-8")
mapping에다가 produces를 붙임.
2. 1번과 반대로 controller에 들어갈 때부터 인코딩 깨짐. DB에 이상한 글자가 들어가있길래 확인해 봄.
form태그로 보냈는데....
web.xml에 encoding Filter 추가
'Spring' 카테고리의 다른 글
oracle-Spring 시간 계산은 서버에서 처리 (0) | 2019.10.29 |
---|---|
Numberformatexception 오류 해결 (0) | 2019.10.21 |
File upload + MultipartFile 과 File 정리 (0) | 2019.09.24 |
web.xml,root-context.xml,servlet-context.xml (0) | 2019.06.11 |