Spring Framework ExceptionHandlerExceptionResolver - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework ExceptionHandlerExceptionResolver class.

This code example shows how to use the following methods:
  } 
 
  @Override 
  public void configureHandlerExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers) {
    exceptionResolvers.add(new MessageAwareResponseStatusExceptionResolver());
    exceptionResolvers.add(new ExceptionHandlerExceptionResolver());
  } 
 
  @Override 
  public void addInterceptors(InterceptorRegistry registry) {
    registry.addInterceptor(new LoggingHandlerInterceptor());
    registry.addInterceptor(new TrailingSlashRedirectHandlerInterceptor());
  } 
 
  @Override 
  public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
    configurer.favorParameter(false).favorPathExtension(true);
  } 
 
} 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
 * Extends {@link ExceptionHandlerExceptionResolver} to provide "global"  
 * {@code @ExceptionHandler} methods for use across all controllers. 
 *  
 * <p>Plugged in via {@link WebConfig#configureHandlerExceptionResolvers(java.util.List)}. 
 */ 
public class ExtendedExceptionHandlerExceptionResolver extends ExceptionHandlerExceptionResolver { 
 
	private Object handler; 
 
	private ExceptionHandlerMethodResolver methodResolver; 
	 
	/** 
	 * Provide a handler with @{@link ExceptionHandler} methods. 
	 */ 
	public void setExceptionHandler(Object handler) { 
		this.handler = handler; 
		this.methodResolver = new ExceptionHandlerMethodResolver(handler.getClass()); 
	} 
 
	@Override 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:doResolveHandlerMethodException
	protected ModelAndView doResolveHandlerMethodException( 
			HttpServletRequest request, HttpServletResponse response, 
			HandlerMethod handlerMethod, Exception exception) { 
 
		// Get the ModelAndView to use 
		ModelAndView mav = super.doResolveHandlerMethodException(request, 
				response, handlerMethod, exception); 
 
		// Make more information available to the view 
		mav.addObject("exception", exception); 
		mav.addObject("url", request.getRequestURL()); 
		mav.addObject("timestamp", new Date()); 
		mav.addObject("status", 500); 
		return mav; 
	} 
} 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java