KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > jivan > test > JivanExample


1 /*
2  * JivanExample
3  *
4  * Enhydra super-servlet
5  *
6  */

7
8 package org.enhydra.jivan.test;
9
10 import com.lutris.appserver.server.*;
11 import com.lutris.appserver.server.httpPresentation.*;
12 import com.lutris.appserver.server.session.*;
13 import com.lutris.util.*;
14
15 import java.io.File JavaDoc;
16 /**
17  * The application object.
18  *
19  * Application-wide data would go here.
20  */

21 public class JivanExample extends StandardApplication {
22     
23     public static String JavaDoc rootPath = null;
24     
25     /*
26      * A few methods you might want to add to.
27      * See StandardApplication for more details.
28      */

29     public void startup(Config appConfig) throws ApplicationException {
30       super.startup(appConfig);
31       try {
32         String JavaDoc temp = appConfig.getConfigFile().getFile().getAbsolutePath();
33         int position = temp.lastIndexOf(File.separator);
34         rootPath = temp.substring(0,position);
35       } catch (Exception JavaDoc e) {
36         rootPath = "";
37       }
38         // Here is where you would read application-specific settings from
39
// your config file.
40
}
41     public boolean requestPreprocessor(HttpPresentationComms comms)
42                    throws Exception JavaDoc {
43         return super.requestPreprocessor(comms);
44     }
45
46     /**
47      * This is an optional function, used only by the Multiserver's graphical
48      * administration. This bit of HTML appears in the status page for this
49      * application. You could add extra status info, for example
50      * a list of currently logged in users.
51      *
52      * @return HTML that is displayed in the status page of the Multiserver.
53      */

54     public String JavaDoc toHtml() {
55         return "This is <I>JivanExample</I>";
56     }
57 }
58
59
Popular Tags