我在 DataModel 中设置了一个特殊字符。
我的数据模型public class LaunchModel implements Serializable { private List<LaunchModel> testquestionList; public LaunchModel() { testquestionList=new ArrayList<LaunchModel>(); } //GETTER AND SETTER }
我的控制器方法..
private void setdefaultValues() { LaunchModel temp=new LaunchModel(); List<LaunchModel> tempList=new ArrayList<LaunchModel>(); temp.setQuestion("ΔLMN and ΔXYZ"); tempList.add(temp); this.launchModel.setTestquestionList(tempList); }
我的 JSP 页面..
<h:form id="addAssessmentFormId" enctype="multipart/form-data">
<t:div id="main" forceId="true">
<t:dataList id="questionList" var="question"
value="#{launchPlayer.launchModel.testquestionList}" rowIndexVar="index"
layout="unorderedList" forceId="true">
<t:div>
<h:outputText id="que" value="#{question.question}" />
<h:inputTextarea id="que" value="#{question.question}" />
</t:div>
</t:dataList>
<t:div style="text-align:center;">
<h:commandButton value="save" action="#{launchPlayer.testsaveAssessment}"></h:commandButton>
</t:div>
</t:div>
</h:form>
当它显示该时间时,它会显示正确的特殊字符,但是当单击保存按钮时,它会更改垃圾字符中字符串的值它是如何发生的,我不明白。如何解决这个问题呢。