飞鱼版本在线编辑器
我的eWebEditor.jsp 里的所用的Button.xml总是显示乱码,不知道为什么?我的jsp文件用的是charset=gbk编码,XML用的是<?xml version="1.0" encoding="GBK"?>编码。jsp文件中的汉字正常显示,但在线编辑器中工具栏用的是Button.xml中的汉字,却出现问题,为什么。
我的eWebEditor.jsp 里的所用的Button.xml总是显示乱码,不知道为什么?我的jsp文件用的是charset=gbk编码,XML用的是<?xml version="1.0" encoding="GBK"?>编码。jsp文件中的汉字正常显示,但在线编辑器中工具栏用的是Button.xml中的汉字,却出现问题,为什么。
解决方案 »
- 求助:Struts开发web应用的配置文件struts-config.xml
- 赶问CSDN JAVA版的兄弟们
- 求救!一个关于乱码的奇怪问题,在线等!!
- jsp页面跳转
- FCKeditor使用的端口问题,
- 树形下拉列表如何实现,高手指教(急)
- 帮忙解决个小问题吧??? 在线等
- org.hibernate.LazyInitializationException: could not initialize proxy - no Sessi
- tomcat自启动会不会造成重复启动端口连接,造成端口冲突?
- 请教一个菜鸟的问题,JSP如何识别浏览者的计算机的IP地址,不是192.168.。。。那种
- 关于 新建一个web工程的问题
- httpClient Connection reset
<%@ page contentType="text/html; charset=GBK"%>XML用的是 <?xml version="1.0" encoding="GBK"?>编码。jsp文件中的汉字正常显示,但在线编辑器中工具栏用的是Button.xml中我都是用的GBK(大写编码),问题是。有时候不乱码,有时候乱码。
2、加一个过滤器
public class MyFilter extends HttpServlet implements Filter { private static final long serialVersionUID = 1L;
private FilterConfig filterConfig;
public void init(FilterConfig filterConfig) throws ServletException {
this.filterConfig = filterConfig;
} public void doFilter(ServletRequest request, ServletResponse response,
FilterChain filterChain) {
try {
request.setCharacterEncoding("UTF-8"); //设置中文
filterChain.doFilter(request, response);
} catch (ServletException sx) {
filterConfig.getServletContext().log(sx.getMessage());
} catch (IOException iox) {
filterConfig.getServletContext().log(iox.getMessage());
}
}
public void destroy() {
}
}
不过还有一点,你的整个程序要使用相同的编码