JBoss Encoding utf 8

前端 未结 4 735
一个人的身影
一个人的身影 2020-12-06 13:29

I had problems with my list grids not showing diacritics correctly and I found out that when I inserted from java into the DB the values were already bugged.

A post h

相关标签:
4条回答
  • 2020-12-06 14:06

    This may help you https://community.jboss.org/message/643825#643825

    <system-properties>
        <property name="org.apache.catalina.connector.URI_ENCODING" value="UTF-8"/>
        <property name="org.apache.catalina.connector.USE_BODY_ENCODING_FOR_QUERY_STRING" value="true"/>
    </system-properties>
    
    0 讨论(0)
  • 2020-12-06 14:08

    To be quite sure, you have something with pageEncoding like this?

    <%@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" %>
    <f:loadBundle basename="i18n.messages" var="msg"/>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    
    0 讨论(0)
  • 2020-12-06 14:19

    You can create a Filter that intercepts each request in your application, so into this filter you can set the character encoding. There is a thread to this at developer.jboss. The Filter can be as follow:

     @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() {
       }
    
    
    }
    
    0 讨论(0)
  • 2020-12-06 14:31

    Maybe this will be useful for someone:

    Window > Preferences > General > Workspace > Text file encoding

    0 讨论(0)
提交回复
热议问题