狠狠入ady亚洲精品,久久综合图区亚洲综合图区,亚洲s码欧洲m码吹潮http://m.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://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 發表評論
]]>
主站蜘蛛池模板: 深夜久久AAAAA级毛片免费看| 亚洲日本中文字幕| 久久久久久亚洲精品无码| 日韩插啊免费视频在线观看 | 中文字幕在线免费看| 亚洲午夜精品第一区二区8050| 亚洲人成网站在线播放2019| 大香人蕉免费视频75| 2020亚洲男人天堂精品| 最近中文字幕mv免费高清视频7| 亚洲最大的视频网站| 91在线视频免费播放| 亚洲人成网站色在线观看| 无码永久免费AV网站| 亚洲中文字幕一二三四区苍井空| 最近免费中文字幕4| 亚洲av永久无码| 亚洲国产中文字幕在线观看| 国产精品免费看久久久香蕉| 亚洲精品高清无码视频| 99精品视频免费观看| 亚洲国产激情在线一区| 全部免费毛片免费播放| 一区二区三区免费电影| 久久久久亚洲AV无码专区首| 国产香蕉免费精品视频| 亚洲av综合av一区二区三区 | 一级毛片a免费播放王色电影 | 成人黄色免费网站| 久久亚洲AV成人无码国产最大| 深夜国产福利99亚洲视频| 国产真人无码作爱免费视频| 亚洲专区在线视频| 狠狠久久永久免费观看| 中文在线观看免费网站| 亚洲精品国产福利在线观看| 国产小视频在线观看免费| 久久久99精品免费观看| 亚洲丰满熟女一区二区哦| 亚洲综合在线另类色区奇米| 国产电影午夜成年免费视频|