01: /*
02: * Poker
03: *
04: * Enhydra super-servlet presentation object
05: *
06: */
07:
08: package poker.presentation.login;
09:
10: // Enhydra SuperServlet imports
11: import com.lutris.appserver.server.httpPresentation.HttpPresentation;
12: import com.lutris.appserver.server.httpPresentation.HttpPresentationComms;
13: import com.lutris.appserver.server.httpPresentation.HttpPresentationException;
14: import com.lutris.util.KeywordValueException;
15:
16: import poker.Poker;
17: import poker.spec.FortuneManager;
18:
19: public class WelcomePresentation implements HttpPresentation {
20:
21: public void run(HttpPresentationComms comms)
22: throws HttpPresentationException, KeywordValueException {
23:
24: WelcomeHTML welcome;
25: welcome = (WelcomeHTML) comms.xmlcFactory
26: .create(WelcomeHTML.class);
27:
28: try {
29: Poker mainApp = (Poker) comms.session.getSessionData().get(
30: "app");
31: FortuneManager fortuneManager = mainApp.getFortuneManager();
32: String fortune = fortuneManager.getFortune();
33: welcome.setTextMessage(fortune);
34: } catch (Exception e) {
35: }
36:
37: comms.response.writeDOM(welcome);
38: }
39:
40: }
|