Good morning guys, I have the following problem. My system makes changes to a table in the database, if the content is inserted directly by script in postgres, accenting works normally, but when updating the text by the system, the accent does not work. Here is the code for xhtml and manageBean:
XHTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui"> <h:body> <ui:composition template="/pages/protected/templates/master.xhtml"> <ui:define name="divMain"> <h:form> <h2 style="padding-left:10px;">Customização da Certidão de Dívida Ativa</h2> <table> <tr>
<td>
<h:outputText value="Título do Relatório: " style="margin-left:5px;"/>
</td>
<td>
<p:inputTextarea rows="1"
label="dsTitulo" style="width:1000px;"
counterTemplate="{0} caracteres restantes."
id="dsTitulo"
value="#{div_customizacao_certidao_divida_ativaMB.dsTitulo}"
required="true" />
</td> </tr> <tr>
<td>
<p:commandButton action="#{div_customizacao_certidao_divida_ativaMB.update()}"
value="Salvar" ajax="false">
</p:commandButton>
</td> </tr>
</table> </h:form> </ui:define> </ui:composition> </h:body> </html>
MB
public void update() {
try {
certidaoDividaAtivaCustomizacao.setDescricaoTitulo(getDsTitulo());
getCertidaoDividaAtivaCustomizacaoFacade().update(certidaoDividaAtivaCustomizacao);
displayInfoMessageToUser("Registro salvo com sucesso!");
certidaoDividaAtivaCustomizacao = null;
loadCertidaoDividaAtivaCustomizacao();
} catch (RollbackException ce) {
ce.printStackTrace();
try {
Exception ex = ce;
while (!(ex instanceof BatchUpdateException)) {
ex = (Exception) ex.getCause();
}
} catch (Exception e) {
displayErrorMessageToUser(ce.getMessage());
}
} catch (Exception e) {
displayErrorMessageToUser(e.getMessage());
e.printStackTrace();
}
}