Tutorial by Topics: annotations

In Java, an annotation is a form of syntactic metadata that can be added to Java source code. It provides data about a program that is not part of the program itself. Annotations have no direct effect on the operation of the code they annotate. Classes, methods, variables, parameters and packages are allowed to be annotated.

We can add validations to our application by adding Data Annotations to our model classes. Data Annotations allow us to describe the rules we want applied to our model properties, and ASP.NET MVC will take care of enforcing them and displaying appropriate messages to users.

mvc.net introduces data anotations for model validation. This can also be done in Xamarin

In this topic you'll read about annotations mainly related to Spring MVC. Some of the related annotations are as follows: @Controller, @RequestMapping, @RequestParam, @RequestBody, @ResponseBody, @RestController, @ModelAttribute, @ControllerAdvice, @ExceptionHandler, @ResponseStatus.

Of course there're more annotations which are extremly important as well but not belong directly to Spring MVC. Such as: @Required, @Autowired, @Resource, and many more.

Page 1 of 1