Chapter 2. Saying hello to Struts 2

 

This chapter covers

  • Declaring your architecture
  • Deploying a HelloWorld application
  • Building an XML-based application
  • Using Struts annotations

In the first chapter, we acquainted ourselves with the web application domain, learned how design patterns and frameworks help developers do their jobs, and conducted a quick survey of the Struts 2 architecture and request-processing pipeline. With that, we’ve now finished the abstract portion of the book. This chapter, which concludes the introductory section of the book, provides the practical and concrete details to bring the theoretical concepts from the first chapter down to earth. In particular, this chapter will demonstrate the basic Struts 2 architectural components with the HelloWorld sample application. This application isn’t intended to demonstrate the full complexity of the framework. As we’ve said, we’ll develop a full-featured sample application through the course of the book—the Struts 2 Portfolio application. The purpose of the HelloWorld application is just to get a Struts 2 application up and running.

But before we get to the HelloWorld application, we need to look at the fundamentals of configuring a Struts 2 application. In particular, we’ll introduce at a type of configuration known as declarative architecture.

2.1. Declarative architecture

2.2. A quick hello

2.3. HelloWorld using annotations

2.4. Summary