alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Jetty example source code file (Main.java)

This example Jetty source code file (Main.java) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Jetty tags/keywords

exception, exception, main, resource, resource, server, server, xmlbeanfactory, xmlbeanfactory

The Jetty Main.java source code

package org.mortbay.jetty.spring;

import org.mortbay.jetty.Server;
import org.mortbay.resource.Resource;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.UrlResource;

public class Main
{
	public static void main(String[] args)
		throws Exception	
	{		
		Resource config=Resource.newResource(args.length==1?args[0]:"etc/jetty-spring.xml");
		XmlBeanFactory bf = new XmlBeanFactory(new UrlResource(config.getURL()));
		Server server = (Server) bf.getBean(args.length==2?args[1]:"Server");
		server.join();
	}
}

Other Jetty examples (source code examples)

Here is a short list of links related to this Jetty Main.java source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.