 | package to.msn.wings.jsf.view;
import to.msn.wings.jsf.FortuneTeller; import to.msn.wings.jsf.model.UserInfo;
public class FortuneTellingService { private UserInfo userInfo; private FortuneTeller teller; private String result;
public FortuneTellingService() { }
public void setFortuneTeller(FortuneTeller teller) { this.teller = teller; }
public void setUserInfo(UserInfo userInfo) { this.userInfo = userInfo; }
public String getResult() { return result; }
public String doFortuneTelling() { // 結果をresult フィールドに格納 result = teller.tellFortune(userInfo); // 遷移ケースID "show result" を返す return "show result"; }
public String doRetry() { // UserInfo Bean をクリア userInfo.setBirthYear(null); userInfo.setBirthMonth(null); userInfo.setBirthDay(null); userInfo.setSex(null); userInfo.setBloodType(null);
// 遷移ケースID "retry" を返す return "retry"; } }
|  |