|
SSISO Community검색 |
|
SSISO Community메뉴 |
|
SSISO Community카페 |
|
블로그 카테고리 |
|
|
struts로 검색한 결과 |
|
등록일:2008-03-16 00:30:41 작성자: 제목:스트럿츠에서 한글 인코딩 변환을 처리하는 방법 |
|
//스트럿츠 프레임워크 워크북에서..
package net.javajigi.processor;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.RequestProcessor;
public class MyAppRequestProcessor extends RequestProcessor {
protected boolean processPreprocess(
HttpServletRequest request,
HttpServletResponse response) {
try {
request.setCharacterEncoding("euc-kr");
return true;
} catch (Exception e) {
return false;
}
}
}
스트럿츠 2부터 필터로 처리하면 되지만 1에서는 없으니 이렇게 처리하는거다!
사용법 struts_config.xml에서 <controller/>를 추가한다ㅋ
<controller
contentType = "text/html"
debug = "3"
nocache = "true"
processorClass = "net.javajigi.processor.MyAppRequestProcessor" />
[출처] 스트럿츠에서 한글 인코딩 변환을 처리하는 방법|작성자 어린양이
http://blog.naver.com/dlckdeo81/41814127 |
|
|
|
|
|