呵呵,写错了,应该是“gb2312”,而不是“bg2312”。
楼主太粗心了!:)
楼主太粗心了!:)
解决方案 »
- SQL语句你行不?(至于你行不行我不知道,但我是不行)
- 如何把自动增加行的数据保存到数据库里面,
- struts2.0与struts1.x有哪些重要区别?
- 在更改资料的时候,我设了个按钮时“重新填写”(晴空所填写的信息),这个按钮是怎么实现的
- jsp生成静态页面最好用什么技术?如果要求查询页也生成静态页面呢?急!!!
- 一个奇怪的struts问题
- 无法找到自定义的包!!!
- 转换服务器后出现错误,急,高分相送!
- WebLogic5.1配置后仍无法运行.jsp文件,高手请进:
- lucene4 多表查询
- java如何读取pdf文档的内容?
- 帮我实现apache+tomcat的配置,目标是使php和jsp使用同一个端口,即在同一个目录下可以解释两种语言!
import javax.servlet.http.*;
import java.io.*;
import java.util.*;public class CharFilterServlet extends HttpServlet implements Filter {
private FilterConfig filterConfig;
//Handle the passed-in FilterConfig
public void init(FilterConfig filterConfig) {
this.filterConfig = filterConfig;
}
//Process the request/response pair
public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) {
try {
request.setCharacterEncoding("GBK");//这两句是自己写的,其它都是JBuilder自动生成的
filterChain.doFilter(request, response);//这两句是自己写的,其它都是JBuilder自动生成的 }
catch(ServletException sx) {
filterConfig.getServletContext().log(sx.getMessage());
}
catch(IOException iox) {
filterConfig.getServletContext().log(iox.getMessage());
}
}
//Clean up resources
public void destroy() {
}
}