我对Wicket很新。有人能告诉我为什么语音标记和撇号被textarea渲染为一堆数字和#符号吗?这里有一段代码:TextArea错误地呈现撇号(和语音标记)
public class QuestionOptions extends BasePage{
private int ID;
private String text;
private TextArea optionText,questionText;
private DropDownChoice isOptionCorrect;
private InvalidInputIndicator optionsLabel,isCorrectLabel;
private FeedbackPanel feedback;
public QuestionOptions(final int ID, String questiontext){
this.ID=ID;
text=questiontext;
Form form=new Form("optionsform");
add(form);
feedback=new FeedbackPanel("msgs");
form.add(feedback);
feedback.setOutputMarkupId(true);
questionText=new TextArea("text",new Model(text));
questionText.setEnabled(false);
form.add(questionText);
这个想法是,当设计MCQ问题时,讲师可以给问题添加不同的选项。问题是:如果问题文本包含语音标记或撇号,它们会以滑稽的方式呈现。例如,'do not'这个词被渲染为don ' t。如果有人能为我提供解决这个问题的办法,我会非常感激。
你能有一些样本代码好吗?你的问题在目前的形式上过于通用。 – biziclop 2011-01-29 23:25:24
对,下一步是调用`System.out.println(text);`在那里检查原文是什么。 – biziclop 2011-01-30 00:13:46