开发学院软件开发Java JSF 2 简介: JSF 向导 阅读

JSF 2 简介: JSF 向导

 2010-08-26 00:00:00 来源:WEB开发网   
核心提示: index.xhtml facelet 用 Start the wizard 链接启动这个应用程序,而 done.xhtml facelet 则显示了问题和答案的总结,JSF 2 简介: JSF 向导(3), 对于客户机,就介绍这么多,我们接下来将讨论其中的两个, 此应用程序的两个 questi

index.xhtml facelet 用 Start the wizard 链接启动这个应用程序,而 done.xhtml facelet 则显示了问题和答案的总结。

对于客户机,就介绍这么多。在服务器上,应用程序有三个 bean,我们接下来将讨论其中的两个。

此应用程序的两个 question bean

Question bean,如清单 1 所示,实际上是一个问题、一组答案选项以及一个答案:

清单 1. Question bean

package com.clarity; 
 
import java.io.Serializable; 
 
public class Question implements Serializable { 
 private static final long serialVersionUID = 1284490087332362658L; 
 
 private String question, answer; 
 private String[] choices; 
 private boolean answered = false; // next button is enabled when answered is true 
  
 public Question(String question, String[] choices) { 
  this.question = question; 
  this.choices = choices; 
 } 
 
 public void setAnswer(String answer) { 
  this.answer = answer; 
  answered = true; 
 } 
 
 public String getAnswer()  { return answer;  } 
 public String getQuestion() { return question; } 
 public String[] getChoices() { return choices; } 
 public boolean isAnswered() { return answered; } 
 
 public void setAnswered(boolean answered) { this.answered = answered; }  
} 

上一页  1 2 3 4 5 6 7 8  下一页

Tags:JSF 简介 JSF

编辑录入:爽爽 [复制链接] [打 印]
[]
  • 好
  • 好的评价 如果觉得好,就请您
      0%(0)
  • 差
  • 差的评价 如果觉得差,就请您
      0%(0)
赞助商链接