By Balaji Varanasi

Spring relaxation is a realistic advisor for designing and constructing RESTful APIs utilizing the Spring Framework. This e-book walks you thru the method of designing and development a relaxation software whereas taking a deep dive into layout rules and most sensible practices for versioning, defense, documentation, mistakes dealing with, paging, and sorting.

This booklet offers a short creation to leisure, HTTP, and internet infrastructure. you are going to find out about numerous Spring tasks reminiscent of Spring Boot, Spring MVC, Spring info JPA, and Spring safety and the position they play in simplifying leisure program improvement. you'll how to construct consumers that devour relaxation companies. ultimately, you are going to methods to use the Spring MVC try framework to unit attempt and integration try out your leisure API.

After examining this booklet, you are going to come away with the entire abilities to construct refined leisure purposes utilizing Spring applied sciences.

Show description

Read or Download Spring REST PDF

Best java books

Google Web Toolkit GWT Java AJAX Programming: A step-by-step to Google Web Toolkit for creating Ajax applications fast

Each one bankruptcy covers a sequence of functional projects, exhibiting how you can in attaining a specific helpful consequence – after which learn the way it really works that you can practice your wisdom on your personal designated scenario. Readers will want event writing non-trivial functions utilizing Java. event with constructing internet interfaces comes in handy, yet wisdom of JavaScript and DHTML isn't really required… GWT looks after that!

Java Programming 24-Hour Trainer, 2nd Edition

Java Programming 24-Hour coach, second variation is your entire beginner's advisor to the Java programming language, with easy-to-follow classes and supplemental routines that assist you wake up and operating speedy. step by step guide walks you thru the fundamentals of object-oriented programming, syntax, interfaces, and extra, ahead of development upon your talents to improve video games, internet apps, networks, and automations.

Pro Spring Boot

Fast and productively boost complicated Spring purposes and microservices - out of the field - with minimum fuss on such things as configurations. This e-book will assist you totally leverage the Spring Boot productiveness suite of instruments and the way to use them by using case reviews. seasoned Spring Boot is your authoritative hands-on sensible advisor for expanding your Spring Framework-based company Java and cloud software productiveness whereas lowering improvement time utilizing the Spring Boot productiveness suite of instruments.

The Java EE 6 Tutorial Advanced Topics

The Java EE 6 instructional complicated themes, Fourth version, is a task-oriented, example-driven consultant to constructing company purposes for the Java Platform, company variation 6 (Java EE 6). Written via individuals of the Java EE 6 documentation group at Oracle, this booklet offers new and intermediate Java programmers with a deep figuring out of the platform.

Extra info for Spring REST

Example text

The different return types supported in methods annotated with @RequestMapping are shown in Table 2-4. Table 2-4. Return types and descriptions Return Type Description String Represents the logical view name. Registered view resolvers are employed to resolve the physical view and a response is generated. View Instance representing a view. In this case, no view resolution is performed and the view object is responsible for generating the response. Examples include JstlView, VelocityView, RedirectView, and so on.

Listing 2-15. INTERNAL_SERVER_ERROR); return responseEntity; } @RequestMapping("/stream") public void streamMovie(HttpServletResponse response) throws SQLException { } } The @ExceptionHandler annotated methods can only handle exceptions that occur in the controller or its subclasses. So, if we need to handle SQL exceptions in other controllers, then we need to copy and paste the handleSQLException method in all of those controllers. This approach can pose severe limitations, as exception handling is truly a crosscutting concern and should be centralized.

Handler. SimpleMappingExceptionResolver Exception resolver implementation that maps exception class names to view names. support. DefaultHandlerExceptionResolver Exception resolver implementation that translates standard Spring exceptions to HTTP status codes. mvc. ResponseStatusExceptionResolver Custom exceptions in Spring applications can be annotated with @ResponseStatus, which takes a HTTP status code as its value. This exception resolver translates the exceptions to its mapped HTTP status codes.

Download PDF sample

Rated 4.73 of 5 – based on 25 votes