01: /*
02: * put your module comment here
03: * formatted with JxBeauty (c) johann.langhofer@nextra.at
04: */
05:
06: package phoneList.presentation;
07:
08: import com.lutris.appserver.server.httpPresentation.*;
09: import phoneList.spec.*;
10:
11: /**
12: */
13: public class DoServerPresentation implements HttpPresentation {
14:
15: public void run(HttpPresentationComms comms) throws Exception {
16: String server = null;
17: try {
18: server = comms.request.getParameter("server");
19: } catch (Exception e) {
20: }
21: String port = null;
22: try {
23: port = comms.request.getParameter("port");
24: } catch (Exception e) {
25: }
26: String okTarget = comms.request
27: .getAppFileURIPath("ListPresentation.po");
28: String errTarget = comms.request
29: .getAppFileURIPath("ErrorPresentation.po");
30: ClientPageRedirectException err = new ClientPageRedirectException(
31: errTarget);
32: ClientPageRedirectException ok = new ClientPageRedirectException(
33: okTarget);
34: if ((server == null) || (server.length() == 0)) {
35: err.addArgument("err", "Error: no server name specified.");
36: throw err;
37: }
38: if ((port == null) || (port.length() == 0)) {
39: err.addArgument("err", "Error: no port value specified.");
40: throw err;
41: }
42: PhoneList phoneList = PhoneListFactory
43: .getPhoneList("phoneList.business.PhoneListImpl");
44: try {
45: phoneList.setServerUrl(server, port);
46: } catch (NullPointerException ex) {
47: }
48:
49: throw ok;
50: }
51: }
|