一直用的UTF8,现在用GBK,乱码解决不了 打开http://localhost:8080/test.jsp页面没有乱码。里面的表单提交给struts action,得到的表单数据不是乱码,action再转到test.jsp时。页面就变成问号了。这是什么问题啊? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 过滤器public class EncodingFilter implements Filter{ public EncodingFilter() { pageEncoding = "gb2312"; } public void setFilterConfig(FilterConfig filterConfig) { this.filterConfig = filterConfig; } public void init(FilterConfig config) throws ServletException { filterConfig = config; pageEncoding = config.getInitParameter("encoding"); } public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest hrequest = (HttpServletRequest)request; hrequest.setCharacterEncoding(pageEncoding); chain.doFilter(request, response); } public void destroy() { filterConfig = null; } action转到jsp是乱码,其他的都是好的 那response设置了吗?response.setCharacterEncoding(pageEncoding); 在fombean里做String words=new String(aa.getBytes("ISO8859-1"),"gb2312") Java 后台生成验证码 前台显示问题 页面没跳转,数据库插不进内容 ecside表头锁定 应届生是否需要到培训机构培训学习JAVA开发 如果我的电脑架设一些jdk,jsp相关的web服务那么我的电脑配置应该怎么配?? 刚学struts,有许多概念性的问题搞不清,请高人指点 @@@@@请问如何用JavaScript判断包含文件路径及中文文件名的文件格式@@@ 连接数据库问题啊·· "web-app" must match 请问我的servlet有什么错?不是大吓就不要进 文个奇怪问题 请教:生成EXCEL 文件
{ public EncodingFilter()
{
pageEncoding = "gb2312";
} public void setFilterConfig(FilterConfig filterConfig)
{
this.filterConfig = filterConfig;
} public void init(FilterConfig config)
throws ServletException
{
filterConfig = config;
pageEncoding = config.getInitParameter("encoding");
} public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException
{
HttpServletRequest hrequest = (HttpServletRequest)request;
hrequest.setCharacterEncoding(pageEncoding);
chain.doFilter(request, response);
} public void destroy()
{
filterConfig = null;
}
response.setCharacterEncoding(pageEncoding);
String words=new String(aa.getBytes("ISO8859-1"),"gb2312")