@@ -0,0 +1,2113 @@
+/*%0A * Copyright 2008-2011 the original author or authors.%0A * %0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A * %0A *      http://www.apache.org/licenses/LICENSE-2.0%0A * %0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage com.nominanuda.springmvc;%0A%0Aimport javax.servlet.ServletRequest;%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpServletResponse;%0A%0Aimport org.springframework.web.servlet.DispatcherServlet;%0A%0Aimport com.nominanuda.lang.ReflectionHelper;%0A%0Apublic class JettyChainableDispatcherServlet extends DispatcherServlet %7B%0A%09private static final ReflectionHelper reflect = new ReflectionHelper();%0A%09private static final long serialVersionUID = -3687969916503048020L;%0A%09private static final String UNHANDLED_REQUEST = %22UNHANDLED_REQUEST%22;%0A%09private static final String SETHANDLED_FALSE_CALLED = %22SETHANDLED_FALSE_CALLED%22;%0A%0A%09@Override%0A%09protected void noHandlerFound(HttpServletRequest request,%0A%09%09%09HttpServletResponse response) throws Exception %7B%0A%09%09if(request.getAttribute(SETHANDLED_FALSE_CALLED) == null) %7B%0A%09%09%09if(reflect.safeInstanceOf(request, %22org.eclipse.jetty.server.Request%22)%0A%09%09%09%7C%7C reflect.safeInstanceOf(request, %22org.mortbay.jetty.Request%22)) %7B%0A%09%09%09%09reflect.invokeMethod(request, %22setHandled%22, new Object%5B%5D %7B false %7D);%0A%09%09%09%7D%0A%09%09%09request.setAttribute(SETHANDLED_FALSE_CALLED, true);%0A%09%09%7D%0A%09%7D%0A%09@Override%0A%09protected void doDispatch(HttpServletRequest request, HttpServletResponse response) throws Exception %7B%0A%09%09super.doDispatch(request, response);%0A%09%09if(request.getAttribute(UNHANDLED_REQUEST) != null) %7B%0A%09%09%09noHandlerFound(request, response);%0A%09%09%7D%0A%09%7D%0A%0A%09public static void markRequestAsUnhandled(ServletRequest request) %7B%0A%09%09request.setAttribute(UNHANDLED_REQUEST, true);%0A%09%7D%0A%0A%7D%0A%0A

support class for mounting different wars on same context-path on jetty 6 7 8