文章分类 | 推荐文章 | 最新文章 | 热点文章 | 最新软件 | 精品软件 | 下载排行 | 推荐下载 | WPS | 杀毒软件
清风网络
首 页 软件下载 网络学院
QQ 电脑入门 游戏 操作系统 图形处理 办公软件 媒体动画 精文荟萃 工具软件 网络编程 程序开发 网络技术 认证考试 网站建设 文章专栏
当前位置:清风网络网络编程JSPMysql与JSP网页中文乱码问题的解决方案
精品推荐
特别推荐
·什么是 JSP 技术?
·JSP简介
·JSP数据库操作例程
·新手入门:学习JSP的经典的入门学习资料
·由浅入深学习动态网页制作PHP的编程与应用
·输入汉字自动转为拼音(jsp实现方式)
·经验分享 JSP程序员完全蜕变手册
·JSP实战:JBuilder2005中创建数据库表
·新手入门:JSP基本语法与简单表单处理
·使用技巧:在JSP页面中的应用JavaBean
热点TOP10
·实例解析 在Eclipse3.2上部署JSP全过程
·用JSP构建三层管理信息系统
·JSP读取Text文件
·让我们一起来认识JSP
·用JSP+JavaScript打造二级级联下拉菜单
·什么是 JSP 技术?
·JSP+JDBC(Thin模式)连接Oracle
·Mysql与JSP网页中文乱码问题的解决方案
·三种Web开发主流技术的评价之JSP
·jsp-servlet技术:一篇写的详细的session的好文章

Mysql与JSP网页中文乱码问题的解决方案

日期:2008年8月19日 作者: 查看:[大字体 中字体 小字体]


* is null, this filter instance is not currently configured.
*/
protected FilterConfig filterConfig = null;

/**
* Should a character encoding specified by the client be ignored?
*/
protected boolean ignore = true;

// ------------------------------ Public Methods

/**
* Take this filter out of service.
*/
public void destroy() {

this.encoding = null;
this.filterConfig = null;

}

/**
* Select and set (if specified) the character encoding to be used to
* interpret request parameters for this request.
*
* @param request The servlet request we are processing
* @param result The servlet response we are creating
* @param chain The filter chain we are processing
*
* @exception IOException if an input/output error occurs
* @exception ServletException if a servlet error occurs
*/
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain)
throws IOException, ServletException {

// Conditionally select and set the character encoding to be used
if (ignore (request.getCharacterEncoding() == null)) {
String encoding = selectEncoding(request);
if (encoding != null)
request.setCharacterEncoding(encoding);
}

// Pass control on to the next filter
chain.doFilter(request, response);

}

/**
* Place this filter into service.
*
* @param filterConfig The filter configuration object
*/
public void init(FilterConfig filterConfig) throws ServletException {

this.filterConfig = filterConfig;
this.encoding = filterConfig.getInitParameter("encoding");
String value = filterConfig.getInitParameter("ignore");
if (value == null)
this.ignore = true;
else if (value.equalsIgnoreCase("true"))
this.ignore = true;
else if (value.equalsIgnoreCase("yes"))
this.ignore = true;
else
this.ignore = false;

}

// --------------- Protected Methods

/**
* Select an appropriate character encoding to be used, based on the
* characteristics of the current request and/or filter initialization
* parameters. If no character encoding should be set, return
* <code>null</code>.
* <p>
* The default implementation unconditionally returns the value configured
* by the <strong>encoding</strong> initialization parameter for this
* filter.
*

上一页 [1] [2] [3] 下一页 




上一篇:用于MIDP的URLEncoder类

下一篇:JSP实现文件上传

相关文章:
·卡巴斯基7.0简体中文正式版试用
·不用重装XP系统就可以解决全部故障
·XP系统运行慢?小编自用7招解决
·Windows Vista Ultimate中文旗舰版下载+简单破解(支持迅雷HTTP & BT)
·解决与HTTP 500 – 内部服务器错误错误信息有关的问题
·笔记本电脑无线上网解决方案大比拼
·0X000000该内存不能为read的解决方法
·怎么制作网页
·解决电脑死机故障攻略
·Windows Vista 简体中文版最终价格公布
相关软件:

特别声明:本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系编辑人员,我们尽快予以更正。
[打印本页] [关闭窗口] 转载请注明来源:http://www.vipcn.net
| 帮助(?) | 版权声明 | 友情连接 | 关于我们 | 信息发布
Copyright 2007 www.vipcn.net All Rights Reserved. 鄂ICP备05000083号Powered by:viphot