Core Servlets and Java Server Pages
The book is made up of three parts: Servlets; Java Server Pages; and the supporting technologies.
The nine chapters in the first part are about Servlets, if you read through all nine, you will learn how to handle form data, access the request headers, generate the response, handle cookies and track sessions. The Java way of separating presentation and content, called Java Server Pages (also called "put everything in a single file!"), is discussed in the next section. This section includes using JavaBeans with JSP, creating custom tag libraries and a chapter on integrating servlets and JSP. The third part has three chapters on the supporting technologies -- HTML forms, using Applets as servlet front-ends, and JDBC and Database connection pooling. The appendix provides a short summary of information from each chapter and the book does has a Web site from which you can download the source code for the examples.
The structure of most of the chapters is the same: Introduce a concept, explain the basics and then develop an example that illustrates the concept. In the chapter on "Generating the Server Response: HTTP Status Codes," the various status codes and their purpose are explained followed by an example which is developing a single interface to various search engines on the Web. The other examples developed in this book are a resume-posting service, using cookies to provide customization, the mandatory shopping cart example, and an online travel agent.
Also, scattered along the book are specially marked techniques, notes and warnings called the "Core Approach." For example if there is an error in the dynamic portion of your JSP, it may not be properly translated to a servlet and the server will present a page describing the problem. But if your browser is Internet Explorer 5, then you will see a standard error page instead of the one with the error message. This "user-friendly" feature has to be turned off while debugging JSP pages and this is one of the Core Warnings.
Even though the Servlet API provides a standard for writing portable code their deployment is not standard, at least until Servlet 2.2. While Sun's Java Web Server provides a graphical applet, Apache Tomcat uses an XML file for configuration. This book talks about three servers in specific and provides instructions on how to get your code running with Tomcat 3.1, Java Web Server 2.0 and JavaServer Web Development Kit. There is a section in the first chapter that talks about the installation of each of these servers and specific information on where your classes and jar files should go. Then as we go along the text, the specifics are discussed like how to specify the initialization parameters for servlets or how to configure the server to make the servlets generated from JSPs persistent.
Though the basics are covered well, some serious topics are left out, and the discussion is inadequate on others. The book's coverage of security is very limited, for instance. There is an example of protecting a page using the basic authentication provided by HTTP, but we need more than that for any site that takes a credit card number. There is very limited discussion on SSL and on what it takes to build a secure Web site.
Servlets can (very usefully) provide internationalization using either HTML character entities or Unicode escape sequences. This involves setting the Content-Language in the header and setting the char set in the content type while sending the response. By reading the preferences set by the user in the browser for his language and char set, it is possible to send content in the user's preferred language. The topics of internationalization and customized content generation, though, are totally left out in the book.
For the deployment of Java-based Web applications, the servlet and JSP specifications support a single Web archive file similar to the jar file. The war file will also contain HTML files, images, and applets along with an XML based configuration file, which can then be placed in the directory on the Web server. Though it is mentioned in the introduction that the book covers servlet 2.2 specifications, the Web application archive is not discussed. Also missing is discussion about the new methods in HttpServletRequest that support role-based authorization.
With the knowledge of Servlets and JSP gained from this book do you get enough wisdom to architect a project? No. I wish there was a chapter which stepped back away from all the code and talked about design at a higher level. All the information is there in the book, but only scattered about.
Finally, I have one major gripe against the publisher---Prentice Hall. The margins used are too wide compared to all other publishers, making this book much more thick than required. This, along with the very large font used for section and sub-section titles makes the book look very ugly and the appendix can be used as an example on how not to format text.
To summarize, if you are a Java programmer who wants to start server side programming then this book is for you. The introduction is gentle and the book is illustrated with numerous code samples that you can extend and adapt. But the coverage is not comprehensive, as the discussion on security is limited and internationalization and some topics of the Servlet 2.2 specification are left out.
You can purchase this book at ThinkGeek.
0 of 74 comments (clear)
No comments match the current filter.