1 /* 2 * Copyright 2002-2005 the original author or authors. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 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 */ 16 17 package org.springframework.web.portlet; 18 19 import javax.portlet.RenderRequest; 20 import javax.portlet.RenderResponse; 21 22 /** 23 * Interface to be implemented by objects than can resolve exceptions thrown 24 * during handler mapping or execution, in the typical case to error views. 25 * Implementors are typically registered as beans in the application context. 26 * 27 * <p>Error views are analogous to the error page JSPs, but can be used with 28 * any kind of exception including any checked exception, with potentially 29 * fine-granular mappings for specific handlers. 30 * 31 * @author Juergen Hoeller 32 * @author John A. Lewis 33 * @since 2.0 34 */ 35 public interface HandlerExceptionResolver { 36 37 /** 38 * Try to resolve the given exception that got thrown during on handler execution, 39 * returning a ModelAndView that represents a specific error page if appropriate. 40 * @param request current portlet request 41 * @param response current portlet response 42 * @param handler the executed handler, or null if none chosen at the time of 43 * the exception (for example, if multipart resolution failed) 44 * @param ex the exception that got thrown during handler execution 45 * @return a corresponding ModelAndView to forward to, or null for default processing 46 */ 47 ModelAndView resolveException( 48 RenderRequest request, RenderResponse response, Object handler, Exception ex); 49 50 } 51