01: /**
02: * Copyright (C) 2006 Google Inc.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */package com.google.inject.struts2.example;
16:
17: import org.mortbay.jetty.Connector;
18: import org.mortbay.jetty.Server;
19: import org.mortbay.jetty.webapp.WebAppContext;
20: import org.mortbay.jetty.nio.SelectChannelConnector;
21:
22: /**
23: * Starts the example web server on port 8080. Run from "./struts2/example".
24: */
25: public class Main {
26:
27: public static void main(String[] args) throws Exception {
28: Server server = new Server();
29:
30: Connector connector = new SelectChannelConnector();
31: connector.setPort(8080);
32: server.setConnectors(new Connector[] { connector });
33:
34: WebAppContext webapp = new WebAppContext("./root", "/example");
35: server.addHandler(webapp);
36:
37: server.start();
38: server.join();
39: }
40: }
|