PacktLib: Apache Struts 2 Web Application Development

Apache Struts 2 Web Application Development

Credits

About the Author

Acknowledgement

About the Reviewers

Preface

Struts and Agile Development

Struts 2 in a nutshell

Agile in a nutshell

Real applications in a nutshell

Getting started

Summary

Basic Configuration

Setting up our environment

Getting started with our application

Summary

Actions and ActionSupport

ActionSupport and its interfaces

Implementing our first user story

More action interfaces

Additional action interfaces

Summary

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

OGNL, the Value Stack, and Custom Tags

OGNL

The tag

Calling static methods from OGNL

Conditionals

Collections and iteration

Referencing other pages and actions

Summary

Form Tags

Form tag basics

Summary

Form Validation and Type Conversion

Form validation

Type conversion

Summary

Interceptors

The basics

Interceptors in the default stack

Other important interceptors and interceptor stacks

Writing our own interceptors

Summary

Exceptions and Logging

Handling exceptions in Struts 2

Logging

Summary

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

Advanced JavaScript, the DOM, and CSS

The importance of markup

Adding dynamic form elements

Summary

Themes and Templates

Extracting the templates

A maze of twisty little passages

Other uses of templates

Summary

Rich Internet Applications

What this chapter is and isn't

Dojo tags

The REST plug-in

Summary

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

Documenting our Application

Documenting Java

D´╗┐´╗┐ocumenting web applications

Documenting development

Summary