Beginning Spring. Höller Jürgen. Читать онлайн. Newlib. NEWLIB.NET

Автор: Höller Jürgen
Издательство: Автор
Серия:
Жанр произведения: Зарубежная образовательная литература
Год издания: 0
isbn: 9781118893111
Скачать книгу
of the framework.

      To implement the cross-cutting concerns, Spring AOP provides easy definition of the elements of AOP with XML configuration, but it also supports the AspectJ framework annotations to easily configure the application.

      Spring MVC and Developing RESTful Web Services

      With the Model View Controller (MVC) pattern, the enterprise application can be clearly defined with three layers. Model is the part of the application that handles the logic for the application data. View is the part that handles the display of the data, and Controller is the part that handles the user interaction. Spring provides an MVC subproject to handle the HTTP requests by reducing the boilerplate code needed for accessing request parameters, validations, and conversations and model updates. It also provides a convenient way to define RESTful web services to be used with cutting-edge user-interface frameworks to provide more responsive web applications.

      Spring Security

      Spring Security is the subproject that provides first-class authentication and authorization support for Java-based enterprise applications. The project first started as codename Acegi and then merged into the Spring portfolio. The project conforms to the Servlet API, so it's easy to integrate it with a Java EE–based web application. It also provides optional integration with other Spring frameworks, such as MVC, so it gives consistent usage on its features. In Chapter 12 we provide some neat examples for these feature foundations.

      Spring Cache

      By starting with version 3.1, Spring Framework provides a transparent caching abstraction for enterprise applications by employing various caching frameworks, such as Ehcache and Hazelcast, in the backend.

      The main objective of caching is to reduce the execution of targeted methods by caching the results of method returns with their executed parameters.

       NOTE The Spring Framework is a comprehensive toolset that cannot be covered in a beginner-level book with all of its subprojects and the whole set of their features. This book might not be suitable for readers who seek a showdown of Spring subprojects with an end-to-end explanation.

      This book also focuses on version 4.0.5.RELEASE of the framework, which is the most recent version at the time of writing. Thus the older versions of the framework are not covered with their features in this book.

      WHAT YOU NEED TO RUN THE SAMPLES

      To run the samples that reside in the book you will need

      • Java Development Kit (JDK) 8.0

      • Maven project build and management tool: You can find all the samples given in the book at www.wrox.com/go/beginningspring on the Download Code tab with the Maven-based project structure.

      NOTE Maven demands that the Java Development Kit be installed on your local environment instead of the Java Runtime Environment.

      • A Java web container: For running the web project samples given throughout the book we've used Tomcat 8.0.12 and Jetty version 9.2.3.

      • A Java IDE: The samples given in the book are implemented with Eclipse IDE, but because Maven is used for the project structure, you could build the samples with other IDEs such as NetBeans or IntelliJ IDEA without any difficulty.

      CONVENTIONS

      To help you get the most from the text and keep track of what's happening, we've used a number of conventions throughout the book.

      TRY IT OUT

      The Try It Out is an exercise you should work through, following the text in the book.

      1. They usually consist of a set of steps.

      2. Each step has a number.

      3. Follow the instructions in the steps to complete the activity.

       How It Works

      After each Try It Out, the code you've typed is explained in detail.

       WARNING Boxes like this one hold important, not-to-be forgotten information that is directly relevant to the surrounding text.

       NOTE Notes, tips, hints, tricks, and asides to the current discussion are offset and placed in italic like this.

      As for styles in the text:

      • We highlight new terms and important words when we introduce them.

      • We show filenames, URLs, and code within the text like so: persistence.properties.

      • We present code in two different ways:

      We use a monofont type with no highlighting for most code examples.

      We use bold to emphasize code that's particularly important in the present context.

      Source Code

      As you work through the examples in this book, you may choose either to type in all the code manually or to use the source code files that accompany the book. All of the source code used in this book is available for download at www.wrox.com/go/beginningspring. You will find that the code snippets from the source code are accompanied by a download icon and note indicating the name of the program so you know it's available for download and can easily locate it in the download file. Once at the site, simply locate the book's title (either by using the Search box or by using one of the title lists) and click the Download Code link on the book's detail page to obtain all the source code for the book.

      NOTE Because many books have similar titles, you may find it easiest to search by ISBN; this book's ISBN is 978-1-118-89292-3.

      After you download the code, just decompress it with your favorite compression tool. Alternatively, you can go to the main Wrox code download page at http://www.wrox.com/dynamic/books/download.aspx to see the code available for this book and all other Wrox books.

      ERRATA

      We make every effort to ensure that there are no errors in the text or in the code. However, no one is perfect, and mistakes do occur. If you find an error in one of our books, like a spelling mistake or faulty piece of code, we would be very grateful for your feedback. By sending in errata you may save another reader hours of frustration and at the same time you will be helping us provide even higher quality information.

      To find the errata page for this book, go to http://www.wrox.com and locate the title using the Search box or one of the title lists. Then, on the book details page, click the Book Errata link. On this page you can view all errata that has been submitted for this book and posted by Wrox editors. A complete book list including links to each book's errata is also available at www.wrox.com/ misc-pages/booklist.shtml.

      If you don't spot “your” error on the Book Errata page, go to www.wrox.com/contact/ techsupport.shtml and complete the form there to send us the error you have found. We'll check the information and, if appropriate, post a message to the book's errata page and fix the problem in subsequent editions of the book.

      P2P.WROX.COM

      For author and peer discussion, join the P2P forums at p2p.wrox.com. The forums are a web-based system for you to post messages relating to Wrox books and related technologies and interact with other readers and technology users. The forums offer a subscription feature to e-mail you topics of interest of your choosing when new posts are made to the forums. Wrox authors, editors, other industry experts, and your fellow readers are