0

When I push the "add player" button all my ÅÄÖ characters changes to different characters the first time but not after that. Feels like a have tried all things to get it work. It should add a player to an ArrayList. Any tip is welcome.

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
    xmlns:h="http://xmlns.jcp.org/jsf/html"
    xmlns:f="http://xmlns.jcp.org/jsf/core">

<h:head><meta http-equiv='Content-Type' content='text/html' charset='UTF-8' />
    <title>Add Player</title>
    <h:outputStylesheet library="css" name="style.css" />
</h:head>
<h:body>
    <center>
    <h:form>
    <h:panelGrid columns="2">
<h:outputLabel value="Id:"/> 
<h:inputText  name="id" value="#{id}" required="true"/>
<h:outputLabel value="Name:"/>
<h:inputText name="name" value="#{name}" required="true"/> 
<h:outputLabel value="Age:"/>
<h:inputText value="#{age}" required="true"/>
<h:outputLabel value="Address:"/>
<h:inputText value="#{address}" required="true"/>
<h:outputLabel value="Email:"/>
<h:inputText value="#{email}" required="true"/>
            <br />
        <h:commandButton value="Add Player" type="Submit"
                action="#{allPlayers.addPlayer(id,name,age,address,email)}"/>
        </h:panelGrid>
        </h:form>
        <h:form><h:commandButton value="Show All players" action="listPlayer.xhtml" /></h:form>
    </center>
</h:body>
</html>
Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102
Rohman
  • 11
  • 3
  • You'll probably have to change the encoding (not sure how to do that, though). – Feathercrown Mar 22 '17 at 12:56
  • Possible duplicate of [Set request character encoding of JSF input submitted values to UTF-8](http://stackoverflow.com/questions/17628354/set-request-character-encoding-of-jsf-input-submitted-values-to-utf-8) – Jasper de Vries Mar 22 '17 at 13:46
  • Your meta command is wrong. It should be either simply ``, or the backwards compatible `` – Mr Lister Mar 22 '17 at 18:51

0 Answers0