Spring MVC Cookbook

Spring MVC Cookbook

Language: English

Pages: 466

ISBN: 1784396419

Format: PDF / Kindle (mobi) / ePub


Over 40 recipes for creating cloud-ready Java web applications with Spring MVC

About This Book

  • Configure Spring MVC to build logic-less controllers that transparently support the most advanced web techniques
  • Build an amazing social and financial application that applies microservices patterns on deployment, self-testability, interoperability, cloud architectures, and scalability
  • Fast-paced, practical guide to learn how to set up Spring MVC to produce REST resources and templates as required by the latest front-end best practices

Who This Book Is For

If you are an experienced Java developer, with prior experience in web technologies, and want to step up in your career and stay up-to-date or learn more about Spring Web scalability, this book is for you.

What You Will Learn

  • Structure your project with Maven and create self-tested, domain-specific deployable web archives
  • Generate templates for a responsive and powerful frontend with AngularJS and Bootstrap
  • Build a high performance stateless RESTful and hypermedia application to support your multiple customer experiences
  • Authenticate over REST with a BASIC authentication scheme and OAuth2; handle roles and permissions
  • Document and publish your REST API using Swagger and Swagger UI
  • Scale your Spring web application
  • Communicate through WebSocket and STOMP messages
  • Provide support to your application and efficiently maintain its business features with a relevant test stack

In Detail

Spring MVC is a lightweight application framework that comes with a great configuration by default. Being part of the Spring Framework, it naturally extended and supported it with an amazing set of recognizable annotations. External libraries can be plugged in and plugged out. It also possesses a request flow.

Complete support of REST web services makes the Spring architecture an extremely consistent choice to support your front-end needs and Internet transformations.

From the design of your Maven modules, you will achieve an Enterprise-standard for a stateless REST application based on Spring and Spring MVC with this book.

This guide is unique in its style as it features a massive overview of practical development techniques brought together from the Spring ecosystem, the new JEE standards, the JavaScript revolution and Internet of Things.

You will begin with the very first steps of Spring MVC's product design. Focused on deployment, viability, and maintainability, you will learn the use of Eclipse, Maven, and Git. You will walk through the separation of concerns driven by the microservices principles. Using Bootstrap and AngularJS, you will develop a responsive front-end, capable of interacting autonomously with a REST API.

Later in the book, you will setup the Java Persistence API (JPA) within Spring; learn how to configure your Entities to reflect your domain needs, and discover Spring Data repositories. You will analyze how Spring MVC responds to complex HTTP requests. You will implement Hypermedia and HATEOAS to guide your customer's stateless conversation with the product and see how a messaging-service based on WebSocket can be configured. Finally you will learn how to set up and organize different levels of automated-tests, including logging and monitoring.

Style and approach

A comprehensive, recipe-based guide to creating stunning Java apps with Spring MVC as a result of learning and implementing pro-level practices, techniques, and solutions.

Pro ASP.NET MVC 5

Mastering Play Framework for Scala

TextMate: Power Editing for the Mac

Concurrent Programming in Mac OS X and iOS: Unleash Multicore Performance with Grand Central Dispatch

The Tomes of Delphi : Basic 32-Bit

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

maps them to handlers that belong to business logic operators (Controllers, Interceptors, Filters, and so on). It also provides a set of tools, available as beans for solving recurring web development issues and techniques such as serving a centralized and modular View layer, handling internationalisation, themes, handing exceptions, and so on. Before everything, the DispatcherServlet is a servlet and is defined as such in the web. xml file with a servlet configuration and its servlet-mapping.

http.* Map Instantiates for us a BindingAwareModelMap to be used in the view. java.util.* RedirectAttributes Injects and repopulates a map of attributes and flash attributes maintained over request redirection org. springframework. web.servlet.mvc. support.* Errors Injects the validation results of the argument located just before in the argument list. org. springframework. validation.* SessionStatus Allows tagging with setComplete(Boolean), the completion of a session. This method

case, with the * wildcard, allows whichever request URI starts with a / after the application display name to be eligible for being handled by this method. The wildcard can match a character, a word, or a sequence of words. Consider the following example: /portal/1, /portal/foo, /portal/foo-bar A limitation would be to use another slash in the last sequence: /portal/foo/bar Remember the difference with the table here: /* All resources and directories at the level /** All resources and

17:00", formatter); return new DailyMarketActivityDTO("DAX 30","GDAXI", map, Date.from(ldt.toInstant(ZoneOffset.UTC))); } @Override public List getLastDayMarketsOverview() { List result = Arrays.asList( new MarketOverviewDTO("Dow Jones-IA", "DJI", new BigDecimal(17810.06), new BigDecimal(0.0051)), ... new MarketOverviewDTO("CAC 40", "FCHI", new BigDecimal(4347.23), new BigDecimal(0.0267)) ); return result; } 85 Designing a Microservice Architecture with

xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd"> compiler C:\java\jdk1.8.0_25 compiler If you are not on a Windows machine, change JAVA_HOME in this file to your JDK installation directory (/usr/java/ jdk1.8.0_25). 7. Go back to the navigation panel and

Download sample

Download

About admin