当我按下“添加播放器”按钮时,我的所有ÅÄÖ字符第一次变为不同的字符,但之后却没有变化。像一个人的感觉已经尝试了所有的东西,让它工作。它应该将玩家添加到ArrayList
。欢迎任何提示。
<!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>