我用eclipse-j2ee版开发程序, jsp中文语言出现????我用的是编码是gbk和utf-8都用了但是还是出现????我jsp界面里全输入的是静态中文文字,注(用tomcat服务器);
解决方案 »
- 求教!dateFormat.parse cannot be resolved to a type
- 急求linux tomcat异常问题,在线等
- 有人用ldap协议成功操作过microsoft active directory 吗
- jsp里复制和移动文件夹
- 50分问这是什么错误?
- frame如何获取父页面对象?????急
- 大家帮帮我,高分奉上!!!
- 配置Eclipse后无法运行,Eclipse2.1.2 结合Tomcat开发jsp.加入lomboz plugin.运行时报错,有谁帮我看看错在哪里?多谢了
- 安装完jb7后有2个jsp服务器.如何改为自己新安装的jsp服务器?
- 怎么在JSP中实现框架中的查询?
- 50分求助把这个分页调好!!!!
- 用JSP怎么制作“2009-06-19”这样的日期的下拉列表?
public class DoFilter implements Filter
{ public void destroy() {
} public void doFilter(ServletRequest arg0, ServletResponse arg1,
FilterChain arg2) throws IOException, ServletException {
arg1.setCharacterEncoding("GBK");
arg2.doFilter(arg0, arg1);
} public void init(FilterConfig arg0) throws ServletException {
}}在web。xml中配置: <!-- 过滤器 -->
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
其实把页面的编码格式也改成UFT-8的,保持一致
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>