1

可能重复:
JSF 中的 UTF-8 表单提交正在破坏数据

这是我写的代码

    <?xml version='1.0' encoding='ISO-8859-1' ?>
<!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:p="http://primefaces.org/ui"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    </head>
    <body>

        <ui:composition template="../WEB-INF/templates/template.xhtml">

            <ui:define name="titleHeader">
                <h:outputText value="#{bundles.messages['message.NouveauClient']}" styleClass="titreContainer"/>
            </ui:define>

            <ui:define name="content">
                <p:growl  autoUpdate="true"/>
                <h:form>
                    <h:panelGrid columns="1" width="100%" columnClasses="top1,top2">
                        <h:panelGrid columns="2" width="80%">
                            <h:outputText value="#{bundles.messages['message.NomClient']}"/>
                            <p:inputText value="#{clientController.client.nom}" required="true"/>
                            <h:outputText value="#{bundles.messages['message.honoraire']}"/>
                            <p:inputText value="#{clientController.client.honoraire}" required="true"/>
                        </h:panelGrid >
                        <p:commandButton action="#{clientController.newClient()}" value="Valider" ajax="false"/>
                    </h:panelGrid>
                </h:form>
            </ui:define>

        </ui:composition>
    </body>
</html>

这是 newClient 的代码

 public String newClient() {
         serviceClient.create(getClient());
         message.info(new BundleKey("messages", "message.success"));
         return "lstClient";
    } 

问题是:当我放置一个名为 name 的客户端时,zéro它以 name 保存在数据库中 zéro

谁能帮我找到解决这个问题的方法

4

0 回答 0