com.nesscomputing.httpserver.jetty
Class ClasspathResourceHandler

java.lang.Object
  extended by org.eclipse.jetty.util.component.AbstractLifeCycle
      extended by org.eclipse.jetty.util.component.AggregateLifeCycle
          extended by org.eclipse.jetty.server.handler.AbstractHandler
              extended by com.nesscomputing.httpserver.jetty.ClasspathResourceHandler
All Implemented Interfaces:
org.eclipse.jetty.server.Handler, org.eclipse.jetty.util.component.Destroyable, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.LifeCycle

public class ClasspathResourceHandler
extends org.eclipse.jetty.server.handler.AbstractHandler

Serves files from a given folder on the classpath through jetty. Intended to serve a couple of static files e.g. for javascript or HTML. Needs to be configured programatically, can not be used in a jetty.xml file.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener
 
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
org.eclipse.jetty.util.component.LifeCycle.Listener
 
Field Summary
 
Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
 
Constructor Summary
ClasspathResourceHandler(String basePath, String resourceLocation)
           
 
Method Summary
 void handle(String target, org.eclipse.jetty.server.Request baseRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 
Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandler
destroy, doStart, doStop, dumpThis, getServer, setServer
 
Methods inherited from class org.eclipse.jetty.util.component.AggregateLifeCycle
addBean, addBean, contains, dump, dump, dump, dump, dump, dumpObject, dumpStdErr, getBean, getBeans, getBeans, isManaged, manage, removeBean, removeBeans, unmanage
 
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
 

Constructor Detail

ClasspathResourceHandler

@Inject
public ClasspathResourceHandler(String basePath,
                                       String resourceLocation)
Method Detail

handle

public void handle(String target,
                   org.eclipse.jetty.server.Request baseRequest,
                   javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws IOException,
                   javax.servlet.ServletException
Throws:
IOException
javax.servlet.ServletException


Copyright © 2012 Ness Computing, Inc.. All Rights Reserved.