锘??xml version="1.0" encoding="utf-8" standalone="yes"?>欧美xxxx做受欧美88bbw,一区二区三区四区在线免费视频,在线播放三级网站http://www.aygfsteel.com/shenke/category/36149.htmlThe game will end ahead of time,if you give up.zh-cnSat, 22 Nov 2008 18:58:09 GMTSat, 22 Nov 2008 18:58:09 GMT60Struts1.2閲屾彁浜や腑鏂囪〃鍗曞埌ActionForm鍚庣殑涔辯爜闂http://www.aygfsteel.com/shenke/articles/242039.htmlskskSat, 22 Nov 2008 14:35:00 GMThttp://www.aygfsteel.com/shenke/articles/242039.htmlhttp://www.aygfsteel.com/shenke/comments/242039.htmlhttp://www.aygfsteel.com/shenke/articles/242039.html#Feedback0http://www.aygfsteel.com/shenke/comments/commentRss/242039.htmlhttp://www.aygfsteel.com/shenke/services/trackbacks/242039.html    鐢變簬Struts妗嗘灦鐩存帴鎶婅〃鍗曟暟鎹彂閫佺粰浜咥ctionForm錛屾墍浠ヨ繖閲岄潰娌℃湁瀵笻ttpRequestServlet榪涜SetCharacterEncoding,鎵浠ラ粯璁ゆ槸鎸夌収ISO-8859-1(鍙傝Tomcat 婧愪唬鐮佷腑鐨刼rg.apache.catalina.connector.HttpRequestBase涓殑protected void parseParameters()鏂規硶)錛?/p>

    瑙e喅鐨勬柟娉曪紝灝辨槸鍦ㄨ〃鍗曟彁浜ゅ埌ActionForm涔嬪墠瀵箁equest榪涜緙栫爜銆?br /> 絎竴縐嶆柟娉曪紝灝辨槸鍐欎竴涓繃婊ゅ櫒錛屽鎵鏈夎姹傝繘琛岃繃婊?br />
榪囨護鍣ㄤ唬鐮?

package com.first.struts.filters;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

public class SetCharacterEncodingFilter implements Filter {
 
 
private String encoding;
 
private FilterConfig filterConfig = null;
 
 
public void destroy() {
  
this.encoding = null;
  
this.filterConfig = null;

 }


 
public void doFilter(ServletRequest request, ServletResponse response,
   FilterChain chain) 
throws IOException, ServletException {
  request.setCharacterEncoding(
this.encoding);
  chain.doFilter(request, response);
 }


 
public void init(FilterConfig filterConfig) throws ServletException {
  
this.encoding = filterConfig.getInitParameter("encoding");
 }


}



閰嶇疆鏂囦歡web.xml

  <filter>
  
<filter-name>Set Character Encoding</filter-name>
  
<filter-class>com.first.struts.filters.SetCharacterEncodingFilter</filter-class>
  
<init-param>
   
<param-name>encoding</param-name>
   
<param-value>GBK</param-value>
  
</init-param>
 
</filter>

 
<filter-mapping>
  
<filter-name>Set Character Encoding</filter-name>
  
<url-pattern>/*</url-pattern>
 
</filter-mapping>
  
</filter-mapping>




絎簩縐嶆柟娉曟槸鏇挎崲榛樿鐨勬帶鍒跺櫒org.apache.struts.action.ActionServlet
瀛愮被浠g爜:
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionServlet;

public class SetEncodingActionServlet extends ActionServlet {
 
protected void process(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
  
// TODO Auto-generated method stub
  String encoding = getInitParameter("encoding");
  request.setCharacterEncoding(encoding);
  
super.process(request, response);
 }

}



閰嶇疆鏂囦歡web.xml
<servlet>
    
<servlet-name>testAction</servlet-name>
    
<servlet-class>jp.co.ricoh.gtis.others.profile.controllers.SetEncodingActionServlet</servlet-class>
    
<init-param>
      
<param-name>config</param-name>
      
<param-value>/WEB-INF/struts-config.xml</param-value>
    
</init-param>
    
<init-param>
      
<param-name>encoding</param-name>
      
<param-value>Shift_JIS</param-value>
    
</init-param>
    
<load-on-startup>2</load-on-startup>
  
</servlet>

  
<servlet-mapping>
    
<servlet-name>testAction</servlet-name>
    
<url-pattern>*.testdo</url-pattern>
  
</servlet-mapping>

姝や緥錛屽嚒鏄氳繃*.testdo鏉ヨ姹傜殑鏁版嵁錛岄兘浼氱粡榪囧弬鏁癳ncoding璁懼畾鐨勫兼潵緙栫爜銆?br />

鍘熸枃閾炬帴: http://blog.csdn.net/runnerupshi/archive/2006/12/05/1431238.aspx

sk 2008-11-22 22:35 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 常州市| 云林县| 安陆市| 阿克陶县| 固原市| 雷山县| 如皋市| 大冶市| 乌鲁木齐市| 宁乡县| 天津市| 湘阴县| 崇信县| 尚志市| 鄂尔多斯市| 兴山县| 垦利县| 焦作市| 渑池县| 衡山县| 玉环县| 林西县| 麻阳| 永昌县| 平阴县| 河北省| 重庆市| 东兴市| 宁城县| 华坪县| 方正县| 安乡县| 民丰县| 徐汇区| 凤凰县| 定安县| 潞西市| 崇信县| 涿州市| 句容市| 台州市|