Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8227129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:01:04+00:00 2026-06-07T16:01:04+00:00

I have a PrimeFaces 3.3 / JSF application which I deploy to JBoss AS

  • 0

I have a PrimeFaces 3.3 / JSF application which I deploy to JBoss AS 7.1. To display my data I use a p:dataTable with some filtering headers. Here’s the code (after narrowing down the sources):

<p:outputPanel id="custDataTable">            
        <p:dataTable var="item" value="#{customerController.items}" rowKey="#{item.id}"
                        selection="#{customerController.current}" selectionMode="single" id="customersTable">
            <p:column headerText="Surname" sortBy="#{item.surname}" filterBy="#{item.surname}" id="surname">  
                #{item.surname}
            </p:column>  
            <p:column headerText="Age" sortBy="#{item.age}" filterBy="#{item.age}" id="age" styleClass="age">
                #{item.age}
            </p:column>
            <p:column headerText="&nbsp;">
                <p:spacer width="20" height="0" />
                <p:commandButton update=":custForm" ajax="false" action="#{customerController.prepareEdit}" value="edit">
                    <f:setPropertyActionListener value="#{item}" target="#{customerController.current}" />
                </p:commandButton>
            </p:column>
        </p:dataTable>  
</p:outputPanel>

PrimeFaces p:dataTable filtering on the numeric Age column always works but on the Surname column a strange behaviour arises. When the backing bean’s items instance variable has elements with ASCII data in the surname, then filtering works. But when UTF8 data are present, then the filtering works only partially:

[1] I can type UTF8 characters of my locale in the column header field and the results are indeed filtered (that’s the part that works).

[2] The backing bean’s current instance variable is always null. I.e. the binding:

selection="#{customerController.current}"

doesn’t seem to be working. I have added some logging in the CustomerController::prepareEdit method and the value is set to null when the edit p:commandButton is pressed. As a result, I can’t edit an instance filtered on the basis of the surname column (when UTF8 data are present). However the same instance, with the same UTF8 data can be edited when I filter on the numeric age column, or when I don’t filter at all.

To tackle the problem I tried registering a character encoding filter:

public class CharacterEncodingFilter implements Filter {

    @Override
    public void doFilter(ServletRequest req,
                             ServletResponse resp,
                             FilterChain chain)
             throws IOException, ServletException {
        req.setCharacterEncoding("UTF-8");
        resp.setCharacterEncoding("UTF-8");
        chain.doFilter(req, resp);
    }

and registered it in my web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app ...
...
  <filter>                                                                                                                                           
      <filter-name>Character Encoding Filter</filter-name>                                                                                           
      <filter-class>mp.util.CharacterEncodingFilter</filter-class>                                                                                   
  </filter>      
</web-app>

but that didn’t do the trick either.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T16:01:05+00:00Added an answer on June 7, 2026 at 4:01 pm

    You need to ensure that the request character encoding is been set to UTF-8. You can do that with a servlet filter which is been mapped on an URL pattern covering the requests of interest. E.g. /* or just on the servlet name of the FacesServlet.

    @WebFilter("/*")
    public class CharacterEncodingFilter implements Filter {
    
        @Override
        public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws ServletException, IOException {
            request.setCharacterEncoding("UTF-8");
            chain.doFilter(request, response);
        }
    
        // ...
    }
    

    See also:

    • Unicode input retrieved via PrimeFaces input components become corrupted
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use the primefaces dataExporter to export some data and I have
I use Primefaces 3.1, JSF 2.1.6 on Glassfish 3.1.1. I have loads of commandbuttons
I have a (JSF 2.0/ Primefaces 2.2RC-SNAPSHOT) app that has <p:layout> I use a
Can I use jsf component libraries(primefaces) with spring mvc .I have problem with client
I am using JSF 2.0 and PrimeFaces 2.2. I have a data table whose
I use Primefaces 3.2 with ApacheMyfaces on WebSphere Application Server 8. I have a
I have an application developed using Primefaces 2.2.1 and JSF 2.0, deployed on Glassfish
I am developing an application with JSF and PrimeFaces. I have a managed been,
I have an jsf application (mojarra 2.1.8, primefaces 3.3) running on tomcat 6. While
I have a complex jsf page with some widgets developed in PrimeFaces. Up to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.