Daylogs/Java
serlvet 에서 평문 텍스트 응답하기
ohgyun
2008. 9. 25. 10:37
서블릿에서 응답으로 xml 이나 html 대신 일반 평문 텍스트를 응답하려 할 때가 있다.
방법은 간단하다.
response.setContentType("text/plain;charset=UTF-8");
습관처럼 쓰던 text/xml 대신 text/plain 을 써주면 된다.
방법은 간단하다.
response.setContentType("text/plain;charset=UTF-8");
습관처럼 쓰던 text/xml 대신 text/plain 을 써주면 된다.
반응형