BVB Source Codes

spring-mvc-showcase Show ValidationController.java Source code

Return Download spring-mvc-showcase: download ValidationController.java Source code - Download spring-mvc-showcase Source code - Type:.java
  1. package org.springframework.samples.mvc.validation;
  2.  
  3. import javax.validation.Valid;
  4.  
  5. import org.springframework.stereotype.Controller;
  6. import org.springframework.validation.BindingResult;
  7. import org.springframework.web.bind.annotation.RequestMapping;
  8. import org.springframework.web.bind.annotation.ResponseBody;
  9.  
  10. @Controller
  11. public class ValidationController {
  12.  
  13.         // enforcement of constraints on the JavaBean arg require a JSR-303 provider on the classpath
  14.        
  15.         @RequestMapping("/validate")
  16.         public @ResponseBody String validate(@Valid JavaBean bean, BindingResult result) {
  17.                 if (result.hasErrors()) {
  18.                         return "Object has validation errors";
  19.                 } else {
  20.                         return "No errors";
  21.                 }
  22.         }
  23.  
  24. }
  25.  
downloadValidationController.java Source code - Download spring-mvc-showcase Source code
Related Source Codes/Software:
tushare - TuShare is a utility for crawling historical data ... 2017-01-12
raml-spec - RAML Specification http://raml.... 2017-01-12
android-stackblur - Android StackBlur is a library that can perform a ... 2017-01-12
sound-redux - A Soundcloud client built with React / Redux ... 2017-01-12
httpstat - curl statistics made simple 2017-01-12
discover-flask - Full Stack Web Development with Flask. ... 2017-01-12
micro - Async HTTP microservices made easy ... 2017-01-12
gobot - Golang framework for robotics, drones, and the Int... 2017-01-11
mas - 2017-01-13
Zappa - Serverless Python Web Services ... 2017-01-12
Codiad - Web Based, Cloud IDE http:/... 2017-05-01
jQuery-Tags-Input - Magically convert a simple text input into a cool ... 2017-05-01
SpoofMAC - 2017-05-01
bowser - a browser detector 2017-04-30
Timepiece - Intuitive date handling in Swift 2017-04-30
angularUtils - A place where I will collect useful re-usable Angu... 2017-04-30
Learning-SICP - The construction and interpretation of computer pr... 2017-04-30
SketchToAppStore - A sketch framework to make creating screenshots fo... 2017-04-30
hyperapp - 1kb JavaScript library for building frontend appli... 2017-04-30
split - 2017-04-30

 Back to top