KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > golfShop > presentation > xmlc > login > Logout


1 /*
2  * Enhydra Java Application Server
3  * The Initial Developer of the Original Code is Lutris Technologies Inc.
4  * Portions created by Lutris are Copyright (C) 1997-2000 Lutris Technologies
5  * Inc.
6  * All Rights Reserved.
7  *
8  * The contents of this file are subject to the Enhydra Public License Version
9  * 1.0 (the "License"); you may not use this file except in compliance with the
10  * License. You may obtain a copy of the License at
11  * http://www.enhydra.org/software/license/epl.html
12  *
13  * Software distributed under the License is distributed on an "AS IS" basis,
14  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
15  * License for the specific language governing rights and limitations under the
16  * License.
17  *
18  *
19  */

20
21 package golfShop.presentation.xmlc.login;
22
23 import org.enhydra.xml.xmlc.*;
24 import org.enhydra.xml.xmlc.html.*;
25 import com.lutris.appserver.server.httpPresentation.*;
26 import com.lutris.appserver.server.session.*;
27 import java.io.*;
28 import org.w3c.dom.*;
29 import org.w3c.dom.html.*;
30 import golfShop.GolfShop;
31 import golfShop.spec.user.*;
32 import golfShop.presentation.xmlc.utilities.*;
33
34
35 /**
36  * This presentation object dynamically creates an HTML page showing
37  * that the user is logged out. A button allows the user to login again.
38  */

39 public class Logout implements HttpPresentation {
40     /**
41      * Entry.
42      */

43     public void run(HttpPresentationComms comms)
44         throws HttpPresentationException, IOException, SessionException {
45
46         GolfShop application = (GolfShop)comms.application;
47         GolfShopUserManager userManager = application.getUserManager();
48        try{
49         userManager.logout(comms.session);
50 /*
51  * We need to allow GolfShop_pres to be functional
52  */

53    
54     } catch(NullPointerException JavaDoc ex) {
55        }
56         LogoutHTML htmlObj
57             = (LogoutHTML)comms.xmlcFactory.create(LogoutHTML.class);
58         comms.response.writeDOM(htmlObj);
59     }
60 }
61
Popular Tags