This book is a rapid and effective Struts tutorial for Java developers. It is a step-by-step introduction to building Struts web applications. The book builds a fully-featured online bookstore application incrementally, with each stage described in detail.
Each chapter begins with a short introduction and ends with in-depth questions and a short summary. Each chapter builds up on the previous one. Those readers who are already familiar with Struts can skip individual chapters, but they should at least skim through those chapters, so they won’t lose the plot and it will also help them to keep up with the web application development part of the book.
Here is an overview for the content of the each chapter:
Chapter 1 presents an overview of Struts in compact form.
Chapter 2 explains the installation for the Struts and shows the first, very easy example. The aim is to start working and experimenting with a fully running system. If you have worked with Struts before, you can skip this chapter.
Chapter 3 introduces the concept the book is based on—the web application called the "Book Store". This will be built, expanded and adapted step-by-step in the following chapters. The underlying design will be introduced in this chapter.
Chapter 4 discusses Internationalization—the possibility to adapt the text of a web site for different languages. Here are some further information and tricks: Custom Actions are explained and a particular Custom Action will be developed.
Chapter 5 emphasizes the importance of correct logging and use of configuration data for software quality. This chapter presents different implementation approaches.
Chapter 6 discusses forms. Handling forms is a standard problem. Error handling in particular generally requires the same mechanisms. Struts offers various possibilities for simplifying this task. Furthermore, this chapter gives insight on how to access databases.
Chapter 7 introduces Logic Tags which allow us to manage conditional generation of a web page via HTML tags. Logical statements such as Loops and If statements are explained in this chapter.
Chapter 8 discusses error handling, the central element of any application. A well-designed shop will always display an error message; after all it’s about the customer’s convenience.
Chapter 9 discusses the controller and templates. The basic process for the controller in the Model 2-concept is manually implemented and subsequently explained for Struts. Templates (Tiles) allow modular design of the web site and easy alteration.
Chapter 10 is quite an extensive chapter where the elements of the shop are further expanded and merged together as one package. Authorization is implemented, a shopping cart is built and the order process completed.
Chapter 11 offers interesting additional information on Struts independent of our online shop.
Chapter 12 discusses JSTL—frequently called a successor of Struts. Here is a short overview of how these two techniques can be combined together.
Chapter 13 gives useful tools and enhancements for Struts as well as practical solutions for frequently encountered problems.
Appendix A is the Solutions section. Here you will find answers to several exercises. Do yourself a favor and look into this section only after you have solved the problem yourself!
Appendix B contains a Glossary explaining important concepts.
Appendix C contains Literature where you will find some more book tips.
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
New terms and important words are introduced in a bold-type font. Words that you see on the screen, in menus or dialog boxes for example, appear in our text like this: "clicking the Next button moves you to the next screen".
Feedback from our readers is always welcome. Let us know what you think about this book, what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply drop an e-mail to< [email protected]>
, making sure to mention the book title in the subject of your message.
If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or e-mail< [email protected]>
.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
Visithttp://www.packtpub.com/support, and select this book from the list of titles to download any example code or extra resources for this book. The code files available for download will then be displayed.
Although we have taken every care to ensure the accuracy of our contents, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in text or code—we would be grateful if you would report this to us. By doing this you can save other readers from frustration, and help to improve subsequent versions of this book.
If you find any errata, report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the Submit Errata link, and entering the details of your errata. Once your errata have been verified, your submission will be accepted and the errata added to the list of existing errata. The existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
You can contact us at< [email protected]>
if you are having a problem with some aspect of the book, and we will do our best to address it