Spring MVC Beginner's Guide
eBook - ePub

Spring MVC Beginner's Guide

Amuthan G

Share book
  1. 304 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Spring MVC Beginner's Guide

Amuthan G

Book details
Book preview
Table of contents
Citations

About This Book

In Detail

The MVC architecture for developing web applications continues to be a powerful concept and the most popular design pattern known by developers. Spring MVC is a model-view-controller framework for Java web applications to simplify the writing and testing of Java web applications, which fully integrates with the Spring dependency injection framework. With the power of annotation-based configuration, Spring MVC makes web application development easy for developers.

This book is a great companion for beginners who want to learn Spring MVC. With the help of real-world examples, you will learn how to create a completely functional web application. You will also get a complete overview of the Spring web development environment and all its key components.

Approach

A step-by-step pragmatic approach to web application development using Spring MVC, with relevant screenshots and concise explanations.

Who this book is for

This book is aimed at helping Java developers who want to teach themselves Spring MVC, even if they have no previous experience with Spring MVC. It would be helpful to have a bit of familiarity with basic servlet programming concepts, but no prior experience is required.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on β€œCancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Spring MVC Beginner's Guide an online PDF/ePUB?
Yes, you can access Spring MVC Beginner's Guide by Amuthan G in PDF and/or ePUB format, as well as other popular books in Computer Science & Web Programming. We have over one million books available in our catalogue for you to explore.

Information

Year
2014
ISBN
9781783284870
Edition
1

Spring MVC Beginner's Guide


Table of Contents

Spring MVC Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Time for action – heading
What just happened?
Pop quiz – heading
Have a go hero – heading
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Configuring a Spring Development Environment
Setting up Java
Time for action – installing JDK
Time for action – setting up environment variables
Configuring a build tool
Time for action – installing the Maven build tool
Installing a web server
Time for action – installing the Tomcat web server
Configuring a development environment
Time for action – installing Spring Tool Suite
Time for action – configuring Tomcat on STS
What just happened?
Time for action – configuring Maven on STS
Creating our first Spring MVC project
Time for action – creating a Spring MVC project in STS
What just happened?
Spring MVC dependencies
Time for action – adding Spring jars to the project
What just happened?
Time for action – adding Java version properties in pom.xml
A jump-start to MVC
Time for action – adding a welcome page
What just happened?
The dispatcher servlet
Time for action – configuring the dispatcher servlet
What just happened?
Deploying our project
Time for action – running the project
Summary
2. Spring MVC Architecture – Architecting Your Web Store
The dispatcher servlet
Time for action – examining request mapping
What just happened?
Pop quiz – request mapping
The web application context
Time for action – understanding the web application context
What just happened?
Pop quiz – the web application context
The web application context configuration
Pop quiz – web application context configuration
View resolvers
Time for action – understanding InternalResourceViewResolver
What just happened?
Model View Controller
An overview of the Spring MVC request flow
The web application architecture
The domain layer
Time for action – creating a domain object
What just happened?
The persistence layer
Time for action – creating a repository object
What just happened?
The service layer
Time for action – creating a service object
What just happened?
Have a go hero – accessing the product domain object via a service
An overview of the web application architecture
Have a go hero – listing all our customers
Summary
3. Control Your Store with Controllers
Defining a controller
Time for action – adding class-level request mapping
What just happened?
Pop quiz – class-level request mapping
The role of a controller in Spring MVC
Handler mapping
Using URI template patterns
Time for action – showing products based on category
What just happened?
Pop quiz – request path variable
Using matrix variables
Time for action – showing the products based on filter
What just happened?
Understanding request parameters
Time for action – adding the product details page
What just happened?
Pop quiz – the request parameter
Time for action – implementing a master detail view
What just happened?
Have a go hero – adding multiple filters to list products
Summary
4. Working with Spring Tag Libraries
Serving and processing forms
Time for action – serving and processing forms
What just happened?
Customizing data binding
Time for action – whitelisting form fields
What just happened?
Externalizing text messages
Time for action – externalizing messages
What just happened?
Using Spring Security tags
Time for action – adding a login page
What just happened?
Summary
5. Working with View Resolver
Resolving views
The redirect view
Time for action – examining RedirectView
What just happened?
Pop quiz – redirect view
Serving static resources
Time for action – serving static resources
What just happened?
Pop quiz – static view
Time for action – adding images to the product detail page
What just happened?
The multipart request in action
Time for action – adding images to the product page
What just happened?
Have a go hero – uploading product user manuals to the server
Using ContentNegotiatingViewResolver
Time for action – configuring ContentNegotiatingViewResolver
What just happened?
Working with the handler exception resolver
Time for action – adding the response status exception
What just happened?
Time for action – adding an exception handler
What just happened?
Summary
6. Intercept Your Store with Interceptor
Working with interceptors
Time for action – configuring an interceptor
What just happened?
Pop quiz – interceptor
Internationalization (i18n)
Time for action – adding internationalization
What just happened?
Have a go hero – fully internationalize the product detail page
Audit logging
Time for action – adding the data audit interceptor
What just happened?
Conditional redirecting
Time for action – intercepting offer page requests
What just happened?
Summary
7. Validate Your Products with a Validator
Bean validation
Time for action – adding bean validation support
What just happened?
Have a go hero – adding more validation in the add products page
Custom validation with JSR-303 / bean validation
Time for action – adding custom validation support
What just happened?
Have a go hero – adding custom validation to a category
Spring validation
Time for action – adding Spring validation
What just happened?
Time for action – combining Spring and bean validations
What just happened?
Have a go hero – adding Spring validation to the product image
Summary
8. Give REST to Your Application with Ajax
Introducing REST
Time for action – implementing RESTful web services
What just happened?
Time for action – consuming REST web services
What just happened?
Handling a web service in Ajax
Time for action – consuming REST web services via Ajax
What just happened?
Summary
9. Apache Tiles and Spring Web Flow in Action
Working with Spring Web Flow
Time for action – implementing the order-processing service
What just happened?
Time for action – implementing the checkout flow
What just happened?
Understanding the flow definition
Understanding the checkout flow
Pop quiz – web flow
Time for action – creating views for every view state
What just happened?
Have a go hero – adding a decision state
Enhancing reusability through Apache Tiles
Time for action – creating views for every view state
What just happened?
Pop quiz – Apache Tiles
Summary
10. Testing Your Application
Unit testing
Time for action – unit-testing domain objects
What just happened?
H...

Table of contents