3 Replies Latest reply on Jan 6, 2012 7:57 AM by Santiago Paz

    About accents and pages.xml

    Santiago Paz Newbie

      Hello, I dont speak english very well, I will try to do my best about this question:

      I have my pages.xml where I define the page flow, I added this line:

          <page view-id="/facElectronica/activarFactura.xhtml" login-required="true" >
              <begin-conversation join="true"/>
              <navigation from-action="#{facElectronicaBean.continuar}">
                  <rule if-outcome="SUCCESS">
                      <end-conversation before-redirect="true"/>
                      <redirect view-id="/comun/exitoTemplate.xhtml">
                          <param name="titulo" value="Factura Electrónica" />

      When I receive the string 'SUCCESS' I redirect to 'exitoTemplate.xhtml', and I send the text 'Factura Electrónica' as a URL parameter. (It's for the title that change dinamically).

      The 'exitoTemplate.xhtml' look like this:

          <ui:define name="body">
              <h:form prependId="false">
                  <table id="mainContent" width="100%" border="0" cellspacing="0" cellpadding="0">
                          <td class="agnt_OrangeText">#{exitoBean.titulo}</td>

      The exitoBean is a Bean where the titulo is saved and displayed.

      The problem is that, when 'exitoTemplate.xhtml' is rendered on the browser, it does not show the correct characters, it look like this:

      Factura Electrónica

      instead of

      Factura Electrónica

      I adjusted my codification with Netbeans ( Properties -> Sources -> Encoding ) as 'UTF-8' but it still doesn't work.

      Any help? Hope you can understand me, thanks a lot.

        • 1. Re: About accents and pages.xml
          Santiago Paz Newbie

          Im sorry, this is the flow for 'exitoTemplate.xhtml' that it is in the pages.xml:

              <!-- Pagina generica de "Operacion exitosa" -->
              <page view-id="/comun/exitoTemplate.xhtml" conversation-required="false" login-required="true">
                  <param value="#{exitoBean.titulo}" name="titulo"/>
                  <navigation from-action="#{exitoBean.aceptar}">
                      <redirect view-id="#{exitoBean.toPage}">
                          <param name="titulo" value="#{exitoBean.titulo}"/>

          • 2. Re: About accents and pages.xml
            Emir Calabuch Newbie

            Hi Santiago,

            Check the encoding of the response with Firebug or similar tool (the encoding in the webpage is indicated in the Content-Type response header, it should be text/html;charset=UTF-8).

            Also check that the encoding is correct in your XML and XHTML files (not only on your editor, but also use the proper XML directive:

            <?xml version="1.0" encoding="UTF-8"?>

            If the encoding in the response is not UTF-8, check that you are setting it correctly. You can set the reponse encoding by adding a meta tag to your main JSF template:

            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

            If none of this works, you can always use the HTML entity definition: &oacute; should give you the accented o.

            • 3. Re: About accents and pages.xml
              Santiago Paz Newbie

              Thanks for your answer, anyway, I solved by another way.

              Bye and thank you.