How to set String value in dataModel in java?

408 views Asked by At
  1. I am reading XML file through Jdom and save into DataModel list.
  2. then display that list in outputText and get in controller that time print correctly.
  3. problem is when I am going to display that list in inputText and get in controller that time it converts special character into junk character
  4. Example

    If in my xml ΔLMN and ΔXYZ text like this then when I am going to save and get from Model n prints on page that time it prints same..but when I am opening that list in inputText and save into Model and prints into console that time it prints \u0394LMN and \u0394XYZ

I am not getting how to solve this problem in java?

Someone told me JDOM have problem in parsing and saving string value, so now I am working on jaxb. But please help me where I'm going wrong.

In jsf page question is my controller .

<h:outputText id="correctAns" value="#{question.questionModel.correctAnswer}" />  

when I am going to print this I got same.

But when i am save from inputext i got junk character when i am going to print in my controller. In my jsp page i have add <%@ page pageEncoding="UTF-8" %>

<h:outputText id="correctAns" value="#{question.questionModel.correctAnswer}" />
0

There are 0 answers