Apache Struts 2 Web Application Development

A beginner's guide for Java developers

Apache Struts 2 Web Application Development

Dave Newton

A beginner's guide for Java developers
Mapt Subscription
FREE
$29.99/m after trial
eBook
$14.70
RRP $20.99
Save 29%
Print + eBook
$34.99
RRP $34.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$14.70
$34.99
$29.99p/m after trial
RRP $20.99
RRP $34.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781847193391
Paperback384 pages

Book Description

Struts 2.1 is a modern, extensible, agile web application framework suitable for both small- and large-scale web applications.

The book begins with a comprehensive look at Struts 2.1 basics, interspersed with detours into more advanced development topics. You'll learn about configuring Struts 2.1 actions, results, and interceptors via both XML and Java annotations. You'll get an introduction to most of the Struts 2.1 custom tags and learn how they can assist in rapid application prototyping and development.

From there you'll make your way into Struts 2.1's strong support for form validation and type conversion, which allows you to treat your form values as domain objects without cluttering your code. A look at Struts 2.1's interceptors is the final piece of the Struts 2.1 puzzle, allowing you to leverage the standard Struts 2 interceptors as well as implement your own custom behavior.

After covering Struts 2.1 you'll journey into the world of JavaScript, a surprisingly capable language, the Document Object Model (DOM), and CSS, and learn how to create clean and concise client-side behavior. You'll leverage that knowledge as you move on to Struts 2 themes and templates, which give you a powerful way to encapsulate site-wide user interface behavior.

The book closes with a look at some tools that make the application development life cycle easier to manage, particularly in a team environment, and more automatic.

Table of Contents

Chapter 1: Struts and Agile Development
Struts 2 in a nutshell
Agile in a nutshell
Real applications in a nutshell
Getting started
Summary
Chapter 2: Basic Configuration
Setting up our environment
Getting started with our application
Summary
Chapter 3: Actions and ActionSupport
ActionSupport and its interfaces
Implementing our first user story
More action interfaces
Additional action interfaces
Summary
Chapter 4: Results and Result Types
The dispatcher result type
The redirect result type
The redirectAction result type
The chain result type (action chaining)
The parse parameter and a usecase detour
The FreeMarker and Velocity result types
The XSLT result type
The plaintext result
The stream result
The httpheader result
The Tiles and JasperReports results
Creating custom result types
Summary
Chapter 5: OGNL, the Value Stack, and Custom Tags
OGNL
The <s:set> tag
Calling static methods from OGNL
Conditionals
Collections and iteration
Referencing other pages and actions
Summary
Chapter 6: Form Tags
Form tag basics
Summary
Chapter 7: Form Validation and Type Conversion
Form validation
Type conversion
Summary
Chapter 8: Interceptors
The basics
Interceptors in the default stack
Other important interceptors and interceptor stacks
Writing our own interceptors
Summary
Chapter 9: Exceptions and Logging
Handling exceptions in Struts 2
Logging
Summary
Chapter 10: Getting Started with JavaScript
Introduction to JavaScript
Minor syntax and language notes
Variables and scoping
Exception handling
Introduction to JavaScript objects and OOP
Functions
Introduction to JavaScript classes
JavaScript modules and OOP
Summary
Chapter 11: Advanced JavaScript, the DOM, and CSS
The importance of markup
Adding dynamic form elements
Summary
Chapter 12: Themes and Templates
Extracting the templates
A maze of twisty little passages
Other uses of templates
Summary
Chapter 13: Rich Internet Applications
What this chapter is and isn't
Dojo tags
The REST plug-in
Summary
Chapter 14: Comprehensive Testing
Test-driven development
Unit testing
Unit tests focus code intent
Testing Struts 2 in context
Client-side (functional) testing
Other forms of testing
Summary
Chapter 15: Documenting our Application
Documenting Java
Documenting web applications
Documenting development
Summary

What You Will Learn

  • Explore the features of Struts 2.1 to develop your application
  • Enhance your web application by writing your own custom result type
  • Create your own type converter to handle custom data types
  • Automatically generate application and development documentation
  • Learn good exception handling practices for your applications
  • Implement rich client behavior using JavaScript, the DOM, and CSS
  • Create custom themes and templates to make shorter, cleaner JSP pages
  • Run many types of tests both to prove functionality and to make change safe

Authors

Table of Contents

Chapter 1: Struts and Agile Development
Struts 2 in a nutshell
Agile in a nutshell
Real applications in a nutshell
Getting started
Summary
Chapter 2: Basic Configuration
Setting up our environment
Getting started with our application
Summary
Chapter 3: Actions and ActionSupport
ActionSupport and its interfaces
Implementing our first user story
More action interfaces
Additional action interfaces
Summary
Chapter 4: Results and Result Types
The dispatcher result type
The redirect result type
The redirectAction result type
The chain result type (action chaining)
The parse parameter and a usecase detour
The FreeMarker and Velocity result types
The XSLT result type
The plaintext result
The stream result
The httpheader result
The Tiles and JasperReports results
Creating custom result types
Summary
Chapter 5: OGNL, the Value Stack, and Custom Tags
OGNL
The <s:set> tag
Calling static methods from OGNL
Conditionals
Collections and iteration
Referencing other pages and actions
Summary
Chapter 6: Form Tags
Form tag basics
Summary
Chapter 7: Form Validation and Type Conversion
Form validation
Type conversion
Summary
Chapter 8: Interceptors
The basics
Interceptors in the default stack
Other important interceptors and interceptor stacks
Writing our own interceptors
Summary
Chapter 9: Exceptions and Logging
Handling exceptions in Struts 2
Logging
Summary
Chapter 10: Getting Started with JavaScript
Introduction to JavaScript
Minor syntax and language notes
Variables and scoping
Exception handling
Introduction to JavaScript objects and OOP
Functions
Introduction to JavaScript classes
JavaScript modules and OOP
Summary
Chapter 11: Advanced JavaScript, the DOM, and CSS
The importance of markup
Adding dynamic form elements
Summary
Chapter 12: Themes and Templates
Extracting the templates
A maze of twisty little passages
Other uses of templates
Summary
Chapter 13: Rich Internet Applications
What this chapter is and isn't
Dojo tags
The REST plug-in
Summary
Chapter 14: Comprehensive Testing
Test-driven development
Unit testing
Unit tests focus code intent
Testing Struts 2 in context
Client-side (functional) testing
Other forms of testing
Summary
Chapter 15: Documenting our Application
Documenting Java
Documenting web applications
Documenting development
Summary

Book Details

ISBN 139781847193391
Paperback384 pages
Read More

Read More Reviews

Recommended for You

Apache Maven 3 Cookbook Book Cover
Apache Maven 3 Cookbook
$ 23.99
$ 16.80
Responsive Web Design with HTML5 and CSS3 Book Cover
Responsive Web Design with HTML5 and CSS3
$ 23.99
$ 4.80
Mastering Web Application Development with AngularJS Book Cover
Mastering Web Application Development with AngularJS
$ 26.99
$ 5.40
Java EE 7 Developer Handbook Book Cover
Java EE 7 Developer Handbook
$ 35.99
$ 25.20
Apache Tomcat 7 Essentials Book Cover
Apache Tomcat 7 Essentials
$ 23.99
$ 16.80
Java EE 6 Cookbook for Securing, Tuning, and Extending Enterprise Applications Book Cover
Java EE 6 Cookbook for Securing, Tuning, and Extending Enterprise Applications
$ 23.99
$ 16.80