Capturar MaxUploadSizeExceededException en Spring Portlet MVC


En el applicationContext.xml

	<bean id="portletMultipartResolver"
		class="org.springframework.web.portlet.multipart.CommonsPortletMultipartResolver">
		<property name="maxUploadSize" value="1000000" />
	</bean>
	
	<bean class="org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver"/>

en el controlado:

	@ExceptionHandler(MaxUploadSizeExceededException.class)
	public ModelAndView handleException1(RenderRequest req, RenderResponse res, Object handler, Exception exception)
	{
		ModelAndView modelAndView = new ModelAndView("uploadFile");
		modelAndView.addObject("message", exception.getMessage());
		return modelAndView;
	}
Anuncios
Capturar MaxUploadSizeExceededException en Spring Portlet MVC