亚洲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 發表評論
]]>
主站蜘蛛池模板: 亚洲国产精品人人做人人爱| 国产v亚洲v天堂a无| 成人国产网站v片免费观看| 最新仑乱免费视频| 亚洲白嫩在线观看| 免费国产黄网站在线观看视频| 亚洲免费日韩无码系列| 国产精品亚洲专区在线播放| 免费看无码自慰一区二区| 国产色在线|亚洲| 亚洲三级高清免费| 亚洲最大黄色网站| 51视频精品全部免费最新| 亚洲第一福利网站| 暖暖免费在线中文日本| 亚洲av无码一区二区乱子伦as| 二区久久国产乱子伦免费精品| 免费大片黄手机在线观看| 婷婷亚洲综合一区二区| 全部免费国产潢色一级| 国内成人精品亚洲日本语音| 国产色婷婷精品免费视频| 亚洲精品成a人在线观看☆| 在线观看成人免费| 亚洲精品女同中文字幕| 四虎成人免费影院网址| 色婷婷亚洲一区二区三区| 国产免费131美女视频| 白白色免费在线视频| 免费va人成视频网站全| 免费手机在线看片| 亚洲精品国产成人影院| 香蕉免费一级视频在线观看| 亚洲免费人成在线视频观看| 精品国产一区二区三区免费| 亚洲国产一区二区a毛片| 18未年禁止免费观看| 亚洲人成免费电影| 全免费一级毛片在线播放| 看成年女人免费午夜视频| 亚洲一区二区三区免费|