亚洲Av无码乱码在线播放,亚洲精品黄色视频在线观看免费资源,亚洲伊人久久大香线蕉苏妲己http://m.tkk7.com/freefly/category/27347.html一門技術(shù),如果不能講出來,那么就是沒有理解,如果不能很好的講出來,那么就是理解不夠透徹!zh-cnThu, 15 Nov 2007 17:34:01 GMTThu, 15 Nov 2007 17:34:01 GMT60solution for mess code in struts+spring+hibernate+mysql4.1 http://m.tkk7.com/freefly/archive/2006/03/23/37026.htmlfreeflyfreeflyThu, 23 Mar 2006 05:07:00 GMThttp://m.tkk7.com/freefly/archive/2006/03/23/37026.htmlhttp://m.tkk7.com/freefly/comments/37026.htmlhttp://m.tkk7.com/freefly/archive/2006/03/23/37026.html#Feedback0http://m.tkk7.com/freefly/comments/commentRss/37026.htmlhttp://m.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 發(fā)表評論
]]>
主站蜘蛛池模板: 猫咪免费人成网站在线观看| 亚洲成a人无码亚洲成av无码| 一个人免费观看www视频| 在线观看免费a∨网站| 国产亚洲中文日本不卡二区| 在线观看av永久免费| 亚洲va乱码一区二区三区| 免费99精品国产自在现线| 久久乐国产综合亚洲精品| 丁香花在线观看免费观看| 亚洲精品无码你懂的| 国产精品免费视频网站| 精品久久亚洲一级α| 亚洲午夜无码片在线观看影院猛| 日产久久强奸免费的看| 亚洲第一极品精品无码久久| 久久99精品免费视频| 亚洲一级毛片免观看| 国产精品免费_区二区三区观看| 国内成人精品亚洲日本语音| 亚洲精品美女久久久久99小说| 在线观看片免费人成视频播放| 亚洲AV无码一区二区乱子伦| 91九色老熟女免费资源站| 亚洲精品美女久久7777777| 免费又黄又爽又猛的毛片| 中文字幕乱码免费看电影| 1区1区3区4区产品亚洲| 免费网站看v片在线香蕉| 色多多A级毛片免费看| 久久精品国产亚洲av麻豆| 日韩免费a级毛片无码a∨| 国产亚洲精品免费| 国产亚洲精品一品区99热| 思思re热免费精品视频66| 美女羞羞视频免费网站| 亚洲AV日韩AV永久无码下载| 搡女人免费视频大全| 久久久受www免费人成| 亚洲国产日韩女人aaaaaa毛片在线| 国产亚洲精品免费|