Book Image

Learning Jakarta Struts 1.2: a concise and practical tutorial

By : Stephan Wiesner
Book Image

Learning Jakarta Struts 1.2: a concise and practical tutorial

By: Stephan Wiesner

Overview of this book

<p>Jakarta Struts is an Open Source Java framework for developing web applications. By cleanly separating logic and presentation, Struts makes applications more manageable and maintainable.<br />Since its donation to the Apache Foundation&nbsp; in 2001, Struts has been rapidly accepted as the leading Java web application framework, and community support and development is well established.<br /><br />Struts-based web sites are built from the ground up to be easily modifiable and maintainable, and internationalization and flexibility of design are deeply rooted. Struts uses the Model-View-Controller design pattern to enforce a strict separation between processing logic and presentation logic, and enables efficient object re-use.<br /><br />The book is written as a structured tutorial, with each chapter building on the last. The book begins by introducing the architecture of a Struts application in terms of the Model-View-Controller pattern. Having explained how to install Jakarta and Struts, the book then goes straight into an initial implementation of the book store. The well structured code of the book store application is explained and related simply to the architectural issues.<br /><br />Custom Actions, internationalization and the possibilities offered by Taglibs are covered early to illustrate the power and flexibility inherent in the framework. The bookstore application is then enhanced in functionality and quality through the addition of logging and configuration data, and well-crafted forms. At each stage of enhancement, the design issues are laid out succinctly, then the practical implementation explained clearly. This combination of theory and practical example lays a solid understanding of both the principles and the practice of building Struts applications.</p>
Table of Contents (20 chapters)
Learning Jakarta Struts 1.2
Credits
Preface
About the Book
Glossary
Literature

Chapter 12: JSTL


Exercise 3

1. What happens, if you mistype and write <c:out value="${x.mitle}" /> instead of <c:out value="${x.title}" />

Compare that with the following: <c:forEach var="x" items="${cat.books}"> instead of

The old notation gives out a compilation error. The use of JSTL does not give this error. See also the next exercise for this.

2. What are the effects of not treating null pointers as errors, but simply ignoring them? How does it affect the troubleshooting process? You might have sensed that very strong opinions have been expressed about this. Do not just accept it. Find out the arguments against it. It’s something the developers from Sun thought long and hard about before choosing this behavior. If you don’t have enough related experience, then talk to a veteran who’s had to maintain a program with more than ten thousand lines. Ask a Perl guru if they have ever used the strict option and why.

Lot of people would have learned programming on the C64 with Basic and considered JavaScript, Perl, and PHP to be their kind of programming languages. But once you learn Java, do some projects, and use server-side JavaScript in complex projects, you start admiring it despite its complexities. This is mainly because the compiler eliminates many sources of errors. With client-side JavaScript, it often happens that one of the branches of an If statement is called only after weeks. To find and correct errors in that particular If statement (which might be just spelling mistakes) at that point