Introduction

 < Day Day Up > 



Throughout my experiences in server-side development, I have assembled many applications using many different technology combinations. Of all of these, I am most impressed with the Java server-side technologies, including servlets, EJBs, JSPs, and JSP custom tags.

This text focuses on a particular server-side Java framework, known as the Jakarta Struts project, or simply enough Struts. Struts combines two of the most popular server-side Java technologies—JSPs and servlets—into a server-side implementation of the Model-View-Controller design pattern. It was conceived by Craig McClanahan in May of 2000, and has been under the watchful eye of the Apache Jakarta open source community since that time.

The remarkable thing about the Struts project is its early adoption, which is obviously a testament to both its quality and utility. The Java community, both commercial and private, has really gotten behind Struts. It is currently supported by all of the major application servers including BEA, Sun, Caucho, and of course Apache's Jakarta-Tomcat. The Tomcat group has even gone so far as to use a Struts application in its most recent 4.0.4 release for managing Web applications hosted by the container.

This book covers everything you need to know about the Struts 1.1 project and its supporting technologies, including JSPs, servlet, Web applications, the Validator framework, the Tiles framework, and the Jakarta-Tomcat JSP/servlet container. We also cover best practices, discuss design issues, and warn of potential roadblocks with each technology. The goal of this text is to provide you with the foundation you need to design, build, and deploy Jakarta Struts applications with all of the Struts 1.1 features and techniques.

As I have stated with most of my book projects, there will be topics that I have not discussed but that are of interest to individual readers. If you run across such an issue or just have a question, please feel free to contact me at <books@virtuas.com> or Rick Hightower at <rick_m_hightower@hotmail.com.> In these e-mails, please be sure to place the text "Jakarta-Struts" in the subject line.

Thanks and good luck,

James Goodwill III

The Organization of the Book

The book you are about to begin is formatted as a tutorial describing the Jakarta Struts project. It is divided into 16 distinct chapters, beginning with an introduction of Struts and continuing with discussions about each of the major Struts components:

Chapter 1: Introducing the Jakarta Struts Project and Its Supporting Components lays the groundwork for the complete text. We introduce the Jakarta Struts project and discuss the Model-View-Controller (MVC) design pattern that it's based on. We also define Java Web applications and explain how to construct and use them. In addition, we examine the Jakarta-Tomcat Web application container, the container used for all our examples.

Chapter 2: An Overview of the Java Servlet and JavaServer Pages Architectures contains a JSP and servlet primer. It is aimed at the Java developer who is not yet familiar with these two, technologies. These topics are the foundation of Jakarta Struts projects, and you must understand them before continuing with the text.

Chapter 3: Getting Started with Struts is where we first encounter actual Struts code. This chapter covers the step-by-step process of building a Struts application by taking you through the development of a simple Struts application.

Chapter 4: Actions and the ActionServlet begins our first detailed discussions of an individual group of Struts components. In this chapter, we look at four distinct Struts Controller components: the ActionServlet class, the Action class, Plugins, and the RequestProcesser.

Chapter 5: Advanced Action Classes continues our Controller discussions with a look at some prepackaged Struts Action classes including the DispatchAction, ForwardAction, IncludeAction, LookupDispatchAction, and SwitchAction.

Chapter 6: Building the Presentation Layer discusses the Struts implementation of the View component of the MVC design pattern. This chapter covers everything you need to know when connecting JSPs to a Struts Controller. We also briefly discuss some of the tag libraries provided by the Struts framework.

Chapter 7: Debugging Struts Applications takes you through the process of configuring the Eclipse and IntelluJ IDEs for debugging Struts application. This chapter discusses both debugging your applications and stepping though the actual Struts framework.

Chapter 8: Working with Custom ActionMappings discusses the org.apache.struts.action.ActionMapping class, which provides the information that the ActionServlet needs knows about the mapping of a request to a particular instance of an action class. After describing the default ActionMapping, we go on to explain how you can extend the ActionMapping class to provide specialized mapping information to the ActionServlet.

Chapter 9: Internationalizing Your Struts Applications describes the Struts mechanisms for internationalized application development. Here, we examine each of the components used and provide an example of internationalizing a Struts application.

Chapter 10: Managing Errors looks at some of the methods available to you when you're managing errors in a Struts application. We begin by looking at the different error classes provided by the Struts framework, and we show how errors can be managed in both the Controller and Views of a Struts application by adding error handling to a sample application.

Chapter 11: Integrating the Jakarta Commons Database Connection Pool (DBCP) discusses how you can leverage the Commons Database Connection Pool's functionality to manage a DataSource connected to a sample database.

Chapter 12: Working with the Validator In this chapter, you will learn how to use Struts to validate form fields. We go a step further and cover best practices regarding validation, and then have you develop your own validator components.

Chapter 13: Using Tiles will describe the newly contributed Tiles templating mechanism and provide several examples of how Tiles can be used to give your application a common look and feel, while also saving you a tremendous amount of time on the presentation layer. We take the Tiles coverage further and show you how to create tile based visual components, managed tile scope and write tile controllers.

Chapter 14: Developing a Compete Struts Application takes you through the development of an entire Struts application. The purpose of this chapter is to tie all of the previous discussions together by creating a practical Struts application.

Chapter 15: The struts-config.xml File describes the struts-config.xml file, the Struts deployment descriptor. We tell you how you can add and configure each major Struts component in this file.

Chapters 16–20: The Struts Custom Tag Libraries describe the Struts framework's tag libraries. In these chapters, we examine each of the Struts tag libraries, including the Tiles, Bean, HTML, Logic, and Template tag libraries. We describe the custom tags in the library, look at their attributes, and provide examples of how they can be used.

Chapter 21: Struts Cookbook contains a wealth of advanced material that will enable you to get the most out of Struts and this book. Think of it as a cookbook for recipes that will help you solve common problems in your Web application development with Struts. We cover transaction tokens, dynamically changing locale, i18n enabled messaging, allow user to cancel an operation, Best Practices and much more. You may want to read the Best Practices section before you start your first Struts application. Then, for good measure, we throw in a list of related tools you should consider using when developing Struts applications namely JSTL (tags and API), Cactus, StrutsTestCase, and XDoclet.



 < Day Day Up > 



Professional Jakarta Struts
Professional Jakarta Struts (Programmer to Programmer)
ISBN: 0764544373
EAN: 2147483647
Year: 2003
Pages: 183

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net