国产精品亚洲成在人线,www.亚洲一区,国产精品亚洲综合专区片高清久久久http://www.tkk7.com/freefly/category/27352.html一門技術,如果不能講出來,那么就是沒有理解,如果不能很好的講出來,那么就是理解不夠透徹!zh-cnThu, 15 Nov 2007 17:34:15 GMTThu, 15 Nov 2007 17:34:15 GMT60solution for mess code in struts+spring+hibernate+mysql4.1 http://www.tkk7.com/freefly/archive/2006/03/23/37026.htmlfreeflyfreeflyThu, 23 Mar 2006 05:07:00 GMThttp://www.tkk7.com/freefly/archive/2006/03/23/37026.htmlhttp://www.tkk7.com/freefly/comments/37026.htmlhttp://www.tkk7.com/freefly/archive/2006/03/23/37026.html#Feedback0http://www.tkk7.com/freefly/comments/commentRss/37026.htmlhttp://www.tkk7.com/freefly/services/trackbacks/37026.html Here is my solution for  mess code on page,hope this can help you!
 The point is your database coding should be consistent with the coding of  character that you plan to insert into the database.
 Attention: Here,I take "UTF-8" as default character coding way .
 There are three steps:
 1. set page charset 
     e.g      <%@ page language="java" contentType="text/html; charset=UTF-8" %>
    
 2. create character filter:
     package com.victory.util;

     import javax.servlet.http.HttpServlet;
     import javax.servlet.Filter;
     import javax.servlet.FilterConfig;
     import javax.servlet.ServletException;
     import javax.servlet.ServletRequest;
     import javax.servlet.ServletResponse;
     import javax.servlet.FilterChain;
     import javax.servlet.http.*;
     import java.io.IOException;
     public class CharacterEncodingFilter
       extends HttpServlet
       implements Filter {

       private FilterConfig filterConfig;
       private String targetEncoding = "ASCII";

     /**
      * Called by the web container to indicate to a filter that it is being placed
      * into service.
      *
      * @param filterConfig FilterConfig
      * @throws ServletException
      * @todo Implement this javax.servlet.Filter method
     */
      public void init(FilterConfig filterConfig) throws ServletException {
      this.filterConfig = filterConfig;
      this.targetEncoding = filterConfig.getInitParameter("encoding");
     }

    /**
     * The <code>doFilter</code> method of the Filter is called by the container
     * each time a request/response pair is passed through the chain due to a
     * client request for a resource at the end of the chain.
     *
     * @param request ServletRequest
     * @param response ServletResponse
     * @param chain FilterChain
     * @throws IOException
     * @throws ServletException
     * @todo Implement this javax.servlet.Filter method
     */
     public void doFilter(ServletRequest srequest, ServletResponse sresponse,
                       FilterChain chain) throws IOException, ServletException {
      try {
        HttpServletRequest request = (HttpServletRequest) srequest;
        request.setCharacterEncoding(targetEncoding);
        chain.doFilter(srequest, sresponse);
          }
      catch (ServletException sx) {
         filterConfig.getServletContext().log(sx.getMessage());
          }
      catch (IOException iox) {
         filterConfig.getServletContext().log(iox.getMessage());
        }
      }

    /**
     * Called by the web container to indicate to a filter that it is being taken
     * out of service.
     *
     * @todo Implement this javax.servlet.Filter method
     */
     public void destroy() {
       filterConfig = null;
       targetEncoding = null;
     }
  }
  
  3.config web.xml
    attention: add these to your web.xml
     <filter>
     <filter-name>EncodingFilter</filter-name>
     <filter-class>com.victory.util.CharacterEncodingFilter</filter-class>
     <init-param>
       <param-name>encoding</param-name>
       <param-value>UTF-8</param-value>
     </init-param>
    </filter>
    <filter-mapping>
    <filter-name>EncodingFilter</filter-name>
     <url-pattern>/*</url-pattern>
    </filter-mapping> 
  4.set database configration
     modify the file:    my.ini
     [client]     default-character-set=utf8 
     [mysqld]  default-character-set=utf8
  5.restart Mysql server
  6.modified your table coding way to utf8

     or ceate your table like this :
     CREATE TABLE `user` (
    `ID` int(11) NOT NULL auto_increment,
    `USERNAME` varchar(50) NOT NULL default '',
    `PASSWORD` varchar(50) NOT NULL default '',
     PRIMARY KEY  (`ID`)
     ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 
  7.restrart your tomcat sever

   OK,it's all.

   Authrougn I have sovled   my problem, I think I  don't have enough understanding for it,  So hope    communicate with you! 

   Attention:mess code also exist in your database,through page hasn't mess code.
   
     


   
  
       
     



freefly 2006-03-23 13:07 發表評論
]]>
主站蜘蛛池模板: 午夜国产精品免费观看 | japanese色国产在线看免费| 操美女视频免费网站| 亚洲一级大黄大色毛片| 久久成人国产精品免费软件| 亚洲综合网美国十次| 最近中文字幕大全中文字幕免费| 亚洲第一精品在线视频| 99久9在线|免费| 亚洲熟妇无码爱v在线观看| 99久久免费中文字幕精品| 亚洲激情在线观看| 亚洲成人免费网站| 亚洲videos| 在线免费观看一级毛片| 久久精品国产亚洲AV天海翼| 免费一级一片一毛片| 一个人看的免费高清视频日本| 中文字幕亚洲综合久久菠萝蜜| 三年在线观看免费观看完整版中文 | 在线观看亚洲一区二区| 精品香蕉在线观看免费| 2019亚洲午夜无码天堂| 日韩高清在线免费看| 一区二区免费国产在线观看| 国产成人精品亚洲2020| 女人18一级毛片免费观看| 亚洲AV色欲色欲WWW| 三上悠亚亚洲一区高清| 久久久久国色av免费看| 亚洲天堂男人影院| 亚洲精品老司机在线观看| 日韩内射激情视频在线播放免费| 亚洲国产精品综合一区在线| 午夜免费福利在线观看| 午夜免费国产体验区免费的| 亚洲av中文无码乱人伦在线r▽| 国产精品成人免费福利| 特级毛片aaaa免费观看| 91久久亚洲国产成人精品性色 | 91精品成人免费国产片|