KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > poker > presentation > login > WelcomePresentation


1 /*
2  * Poker
3  *
4  * Enhydra super-servlet presentation object
5  *
6  */

7
8 package poker.presentation.login;
9
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
22   public void run(HttpPresentationComms comms)
23       throws HttpPresentationException, KeywordValueException {
24
25     WelcomeHTML welcome;
26     welcome = (WelcomeHTML)comms.xmlcFactory.create(WelcomeHTML.class);
27       
28    try{
29     Poker mainApp = (Poker)comms.session.getSessionData().get("app");
30     FortuneManager fortuneManager = mainApp.getFortuneManager();
31     String JavaDoc fortune = fortuneManager.getFortune();
32    welcome.setTextMessage(fortune);
33    }catch(Exception JavaDoc e){}
34    
35
36     comms.response.writeDOM(welcome);
37   }
38
39 }
40
Popular Tags