JBoss编码utf 8

我的列表网格没有正确显示变音符号的问题,我发现当我从java插入数据库时​​,值已经被错误。

这里的post有帮助,我改变了我的项目属性 – >文本编码 – >其他 – > UTF-8,这解决了我的问题。 事情是这只能解决我在本地的问题。

我需要做的是在我的Jboss服务器上也以某种方式设置编码。 我只能访问此面板,因为我无法直接访问配置文件。 我可以从这里开始吗?

在此处输入图像描述

对于这个愚蠢的问题,任何建议都表示赞赏和抱歉,但我尝试了所有我能想到的但没有成功的事情。 谢谢。

这可以帮助您https://community.jboss.org/message/643825#643825

    

可以肯定的是,你有像这样的pageEncoding吗?

 <%@page contentType="text/html" pageEncoding="UTF-8"%> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>      

也许这对某些人有用:

Window > Preferences > General > Workspace > Text file encoding

您可以创建一个截取应用程序中每个请求的filter,因此在此filter中可以设置字符编码。 developer.jboss上有一个主题。 filter可以如下:

  @WebFilter(filterName = "CharacterEncodingF", urlPatterns = {"/*"}) public class CharacterEncodingF implements Filter { public CharacterEncodingF() { } /** * * @param request The servlet request we are processing * @param response 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 { request.setCharacterEncoding("UTF-8"); chain.doFilter(request, response); } @Override public void init(FilterConfig filterConfig) throws ServletException { } @Override public void destroy() { } }