01: /*
02: *
03: * Enhydra Java Application Server Project
04: *
05: * The contents of this file are subject to the Enhydra Public License
06: * Version 1.1 (the "License"); you may not use this file except in
07: * compliance with the License. You may obtain a copy of the License on
08: * the Enhydra web site ( http://www.enhydra.org/ ).
09: *
10: * Software distributed under the License is distributed on an "AS IS"
11: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
12: * the License for the specific terms governing rights and limitations
13: * under the License.
14: *
15: * The Initial Developer of the Enhydra Application Server is Lutris
16: * Technologies, Inc. The Enhydra Application Server and portions created
17: * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
18: * All Rights Reserved.
19: *
20: * Contributor(s):
21: *
22: * $Id: Welcome.java,v 1.1 2006-09-11 12:32:47 sinisa Exp $
23: */
24: package enhydraFlash.presentation;
25:
26: import java.util.Date; //import com.lutris.xml.xmlc.*;
27: import com.lutris.appserver.server.httpPresentation.*;
28:
29: public class Welcome implements HttpPresentation {
30:
31: public void run(HttpPresentationComms comms)
32: throws HttpPresentationException {
33: String name = null;
34: try {
35: if ((name = comms.request.getParameter("name")) != null) {
36: handleSubmit(comms, name);
37: } else {
38: WelcomeHTML welcome = (WelcomeHTML) comms.xmlcFactory
39: .create(WelcomeHTML.class);
40: comms.response.writeDOM(welcome);
41: }
42: } catch (Exception e) {
43: System.out.println("EXCEPTION in Welcome" + e);
44: }
45: }
46:
47: public void handleSubmit(HttpPresentationComms comms, String name) {
48:
49: //Put the name in the session.
50: try {
51: comms.session.getSessionData().set("NAME", name);
52: String test = comms.session.getSessionData().getString(
53: "NAME");
54: throw new ClientPageRedirectException("ShowName.po");
55: } catch (Exception e) {
56: System.out.println("EXCEPTION in Welcome" + e);
57: }
58: }
59:
60: }
|