MyRequestProcessor.java
上传用户:jishiqi_cj
上传日期:2022-08-08
资源大小:24765k
文件大小:1k
- package StudyNews;
- import javax.servlet.http.HttpServlet;
- import javax.servlet.http.HttpServletRequest;
- import javax.servlet.http.HttpServletResponse;
- import org.apache.struts.action.RequestProcessor;
- import org.apache.struts.config.ForwardConfig;
- import org.apache.commons.logging.Log;
- public class MyRequestProcessor extends RequestProcessor {
-
- public MyRequestProcessor() {}
-
- protected boolean processPreprocess( HttpServletRequest request,
- HttpServletResponse response ){
-
- try{
- request.setCharacterEncoding("gb2312");
-
- }
- catch(Exception ex){
- System.out.println("字符集设置失败");
-
- }
-
- return true;
- }
- }