Code example for CustomNumberEditor

0
	 * @see org.springframework.web.servlet.mvc.BaseCommandController#initBinder(javax.servlet.http.HttpServletRequest, 
	 *      org.springframework.web.bind.ServletRequestDataBinder) 
	 */ 
	protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception { 
		super.initBinder(request, binder); 
		binder.registerCustomEditor(java.lang.Integer.class, new CustomNumberEditor(java.lang.Integer.class, true)); 
	} 
	 
	/** 
	 * The onSubmit function receives the form/command object that was modified by the input form 
	 * and saves it to the db 
	 * 
	 * @see org.springframework.web.servlet.mvc.SimpleFormController#onSubmit(javax.servlet.http.HttpServletRequest, 
	 *      javax.servlet.http.HttpServletResponse, java.lang.Object, 
	 *      org.springframework.validation.BindException) 
	 */ 
	protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object obj, 
	        BindException errors) throws Exception { 
		 
		HttpSession httpSession = request.getSession(); 
Experience pair programming with AI  Get Codota for Java