Package wicket.contrib.phonebook

Source Code of wicket.contrib.phonebook.StartPhonebook

/*
* $Id: Start.java 889 2006-08-16 11:01:16 -0700 (Wed, 16 Aug 2006) ivaynberg $
* $Revision: 889 $ $Date: 2006-08-16 11:01:16 -0700 (Wed, 16 Aug 2006) $
*
* ==============================================================================
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package wicket.contrib.phonebook;

import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.bio.SocketConnector;
import org.eclipse.jetty.webapp.WebAppContext;

/**
* Seperate startup class for people that want to run the examples directly.
*/
public class StartPhonebook
{
  /**
   * Main function, starts the jetty server.
   *
   * @param args
   */
  public static void main(String[] args)
  {
    Server server = new Server();
    SocketConnector connector = new SocketConnector();
    connector.setPort(8080);
    server.setConnectors(new Connector[] { connector });

    WebAppContext context = new WebAppContext();
    context.setServer(server);
    context.setContextPath("/phonebook");
    context.setWar("src/main/webapp");

    server.setHandler(context);
    try
    {
      server.start();
    }
    catch (Exception e)
    {
      throw new RuntimeException(e);
    }

  }
}
TOP

Related Classes of wicket.contrib.phonebook.StartPhonebook

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.