javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-2434

JSF 2.1.8 character encoding problem during file upload

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Works as designed
    • Affects Version/s: 2.1.8
    • Fix Version/s: None
    • Component/s: ajax
    • Labels:
      None
    • Environment:

      Apache Tomcat 7

      Description

      If you with file upload have also web form for submitting non english fields, like firstname , lastname and add
      <h:form enctype="multipart/form-data"> , you will have character encoding problem.
      I added encoding filter but it did not help for all problems.
      I used latest mojarra and primefaces version under latest apache tomcat 7. in common file upload jar i found boundary = boundaryStr.getBytes("ISO-8859-1") in FileUploadBase , may be connected with it? This problem must solve finally with JSF versions, because this happens when you add <h:form enctype="multipart/form-data"> .

      in the String setters I added
      public void setGuardionname(String guardionname) throws UnsupportedEncodingException {
      guardionname = new String (guardionname.getBytes ("iso-8859-1"), "UTF-8");
      this.guardionname = guardionname;
      }
      its help for add form, but during update the same problem.
      Also its happened if you have validation like <f:validateRegex pattern="[a-zA-Z]*"/>

      How we can solve this finally??

      Best Regards,

      Armen Arzumanyan

        Activity

        Hide
        Manfred Riem added a comment -

        The bug you submitted is related to PrimeFaces and how it handles file uploads. So if you have a problem with it you should file the issue with PrimeFaces so they can fix it. A note on h:form you can specify acceptcharset on the form so any child control can have access to the 'List of character encodings for input data that are accepted by the server processing this form.'

        Show
        Manfred Riem added a comment - The bug you submitted is related to PrimeFaces and how it handles file uploads. So if you have a problem with it you should file the issue with PrimeFaces so they can fix it. A note on h:form you can specify acceptcharset on the form so any child control can have access to the 'List of character encodings for input data that are accepted by the server processing this form.'

          People

          • Assignee:
            rogerk
            Reporter:
            armen2008
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 5 days
              5d
              Remaining:
              Remaining Estimate - 5 days
              5d
              Logged:
              Time Spent - Not Specified
              Not Specified