亚洲AV永久精品爱情岛论坛,亚洲校园春色另类激情,综合偷自拍亚洲乱中文字幕http://www.tkk7.com/freefly/category/27347.html一門技術,如果不能講出來,那么就是沒有理解,如果不能很好的講出來,那么就是理解不夠透徹!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://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 發表評論
]]>
主站蜘蛛池模板: 亚洲人妻av伦理| 99久久久国产精品免费牛牛 | vvvv99日韩精品亚洲| 亚洲爆乳AAA无码专区| 亚洲www在线观看| 日本亚洲成高清一区二区三区| 毛片免费在线视频| 成年午夜视频免费观看视频| 一个人免费观看视频www| 成人毛片免费观看视频在线| 毛片a级毛片免费播放下载| 麻豆精品国产免费观看| 国产曰批免费视频播放免费s| 久草视频免费在线| 日韩精品无码区免费专区| 青青草国产免费久久久91| 免费h黄肉动漫在线观看| 大地资源在线观看免费高清 | 九九免费观看全部免费视频| 一级毛片正片免费视频手机看| 亚洲熟妇无码一区二区三区| 亚洲视频一区网站| 亚洲产国偷V产偷V自拍色戒| 亚洲成色999久久网站| 亚洲人成免费网站| 亚洲欧洲日产专区| 亚洲色大情网站www| 免费人成在线观看播放a| 综合一区自拍亚洲综合图区| 亚洲乱色伦图片区小说 | 亚洲精品成人区在线观看| 亚洲综合伊人久久综合| 亚洲无删减国产精品一区| 九月丁香婷婷亚洲综合色| 亚洲第一成年网站大全亚洲| 亚洲熟妇自偷自拍另欧美| 亚欧国产一级在线免费| 国产精品美女久久久免费| 色欲国产麻豆一精品一AV一免费| 在线观看免费播放av片| 三年片免费高清版|