01: /*
02: * JivanExample
03: *
04: * Enhydra super-servlet
05: *
06: */
07:
08: package org.enhydra.jivan.test;
09:
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;
16:
17: /**
18: * The application object.
19: *
20: * Application-wide data would go here.
21: */
22: public class JivanExample extends StandardApplication {
23:
24: public static String rootPath = null;
25:
26: /*
27: * A few methods you might want to add to.
28: * See StandardApplication for more details.
29: */
30: public void startup(Config appConfig) throws ApplicationException {
31: super .startup(appConfig);
32: try {
33: String temp = appConfig.getConfigFile().getFile()
34: .getAbsolutePath();
35: int position = temp.lastIndexOf(File.separator);
36: rootPath = temp.substring(0, position);
37: } catch (Exception e) {
38: rootPath = "";
39: }
40: // Here is where you would read application-specific settings from
41: // your config file.
42: }
43:
44: public boolean requestPreprocessor(HttpPresentationComms comms)
45: throws Exception {
46: return super .requestPreprocessor(comms);
47: }
48:
49: /**
50: * This is an optional function, used only by the Multiserver's graphical
51: * administration. This bit of HTML appears in the status page for this
52: * application. You could add extra status info, for example
53: * a list of currently logged in users.
54: *
55: * @return HTML that is displayed in the status page of the Multiserver.
56: */
57: public String toHtml() {
58: return "This is <I>JivanExample</I>";
59: }
60: }
|