0% found this document useful (0 votes)
10 views

Beginning JSP Jsf and Tomcat Web Development 1st Edition Giulio Zambon pdf download

The document provides information on the book 'Beginning JSP, JSF, and Tomcat Web Development' by Giulio Zambon, which serves as a guide for developing Java-based web applications. It covers essential topics such as JSP, JSF, Tomcat, HTML, databases, and XML, with a focus on practical examples. The book is aimed at beginner to intermediate developers and includes references and tips for effective programming.

Uploaded by

verweysaboba
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Beginning JSP Jsf and Tomcat Web Development 1st Edition Giulio Zambon pdf download

The document provides information on the book 'Beginning JSP, JSF, and Tomcat Web Development' by Giulio Zambon, which serves as a guide for developing Java-based web applications. It covers essential topics such as JSP, JSF, Tomcat, HTML, databases, and XML, with a focus on practical examples. The book is aimed at beginner to intermediate developers and includes references and tips for effective programming.

Uploaded by

verweysaboba
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

Beginning JSP Jsf and Tomcat Web Development 1st

Edition Giulio Zambon download

https://ebookultra.com/download/beginning-jsp-jsf-and-tomcat-web-
development-1st-edition-giulio-zambon/

Explore and download more ebooks or textbooks


at ebookultra.com
We have selected some products that you may be interested in
Click the link to download now or visit ebookultra.com
for more options!.

Beginning JSP JSF and Tomcat 2nd Edition Java Web


Development Giulio Zambon

https://ebookultra.com/download/beginning-jsp-jsf-and-tomcat-2nd-
edition-java-web-development-giulio-zambon/

Beginning Android Web Apps Development 1st ed. Edition Jon


Westfall

https://ebookultra.com/download/beginning-android-web-apps-
development-1st-ed-edition-jon-westfall/

XML Programming Web Applications and Web Services With JSP


and ASP 1st Edition Alexander Nakhimovsky

https://ebookultra.com/download/xml-programming-web-applications-and-
web-services-with-jsp-and-asp-1st-edition-alexander-nakhimovsky/

Beginning Joomla Web Site Development Wrox Programmer to


Programmer 1st Edition Cory Webb

https://ebookultra.com/download/beginning-joomla-web-site-development-
wrox-programmer-to-programmer-1st-edition-cory-webb/
Head First Servlets JSP Passing the Sun Certified Web
Component Developer Exam 1st Edition Bryan Basham

https://ebookultra.com/download/head-first-servlets-jsp-passing-the-
sun-certified-web-component-developer-exam-1st-edition-bryan-basham/

Beginning CSS Cascading Style Sheets for Web Design Wrox


Beginning Guides 2nd Edition Richard York

https://ebookultra.com/download/beginning-css-cascading-style-sheets-
for-web-design-wrox-beginning-guides-2nd-edition-richard-york/

Beginning iOS Game Development 1st Edition Patrick Alessi

https://ebookultra.com/download/beginning-ios-game-development-1st-
edition-patrick-alessi/

Beginning ASP NET Web Pages with WebMatrix 1st Edition


Mike Brind

https://ebookultra.com/download/beginning-asp-net-web-pages-with-
webmatrix-1st-edition-mike-brind/

SproutCore Web Application Development 1st Edition Keating

https://ebookultra.com/download/sproutcore-web-application-
development-1st-edition-keating/
Beginning JSP Jsf and Tomcat Web Development 1st
Edition Giulio Zambon Digital Instant Download
Author(s): Giulio Zambon, Michael Sekler
ISBN(s): 9781590599044, 1590599047
Edition: 1
File Details: PDF, 6.85 MB
Year: 2007
Language: english
CYAN YELLOW
MAGENTA BLACK
PANTONE 123 C

EMPOWERING PRODUCTIVITY FOR THE JAVA™ DEVELOPER The EXPERT’s VOIce ® in Java™ Technologies
Companion
eBook Available
Beginning JSP,™ JSF,™ and Tomcat™ Web
Development: From Novice to Professional
Beginning
Beginning
Dear Reader,

JSP, JSF, and Tomcat


JSP, JSF,
This book tells you what you need to know to develop Java™-based web applica-
tions with JavaServer Pages™ (JSP™), JavaServer™ Faces (JSF™), and Tomcat.™
In less than one and a half decades, the Web has become a platform capable ™ ™
of delivering complex and powerful applications. At the same time, a bewilder-
Giulio Zambon ing variety of technologies and products has been introduced, all jostling for
recognition and market share.


We decided to write this manual on the basis of two considerations: one
technical and one human in nature. The technical consideration was that the

and Tomcat
alignment of JSP 2.1 and JSF 1.2 achieved with Java Platform, Enterprise Edition
5 (Java EE 5), and the subsequent release of Servlet 2.5 and Tomcat 6, had finally
realized full consistency across the whole platform. The human consideration ™
was that, although a lot of information and documentation is available by
searching the Web, there is a need for a compendium capable of taking a reader
through all the steps necessary to build a Java-based web application.


In our endeavor to cover all the subjects you’ll need, we have included chapters
dedicated to HTML, JSP, databases, JSF, Tomcat, and XML, and sections on Java
and HTTP. We’ve also touched on Cascading Style Sheets (CSS), JavaScript™,

Web Development
Asynchronous JavaScript and XML (Ajax), and Simple Object Access Protocol
(SOAP) and provided detailed references for HTML, JSP, JSF, and SQL.
This is a practical manual driven by examples rather than by abstract con-
cepts. Nevertheless, we have consistently justified and explained every step
taken and every choice made throughout the book. You’ll also discover useful
tips and tricks to make your programming life easier.

From Novice to Professional


If you keep coming back to this book to look up techniques and to check out
options and features, we will have achieved our goal. Happy programming!
Giulio Zambon and Michael Sekler
Companion eBook

Learn and apply the very fundamentals of Java™


THE APRESS JAVA™ ROADMAP
Pro JSP™ 2, 4th Ed. Web development using JSP™ and JSF ™ API, and
deployment using Apache Tomcat ™ 6 server.
See last page for details Beginning JSP™,
on $10 eBook version Pro JSF™ and Ajax
JSF™, and Tomcat™


Pro Apache Tomcat™ 6

SOURCE CODE ONLINE


www.apress.com
java.apress.com
ISBN-13: 978-1-59059-904-4
ISBN-10: 1-59059-904-7 Zambon,
Sekler
Giulio Zambon
53999
with Michael Sekler
US $39.99

Shelve in
Java Programming

User level:
9 781590 599044
Beginner–Intermediate

this print for content only—size & color not accurate spine = 0.894" 472 page count
9047fmfinal.qxd 10/26/07 8:53 PM Page i

Beginning JSP™
,
JSF™
, and Tomcat
Web Development
From Novice to Professional

Giulio Zambon
with Michael Sekler
9047fmfinal.qxd 10/26/07 8:53 PM Page ii

Beginning JSP™, JSF™, and Tomcat Web Development: From Novice to Professional
Copyright © 2007 by Giulio Zambon with Michael Sekler
All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means,
electronic or mechanical, including photocopying, recording, or by any information storage or retrieval
system, without the prior written permission of the copyright owner and the publisher.
ISBN-13 (pbk): 978-1-59059-904-4
ISBN-10 (pbk): 1-59059-904-7
Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1
Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence
of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark
owner, with no intention of infringement of the trademark.
Java™ and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc., in the
US and other countries. Apress, Inc., is not affiliated with Sun Microsystems, Inc., and this book was writ-
ten without endorsement from Sun Microsystems, Inc.
Lead Editor: Steve Anglin
Technical Reviewer: Kunal Mittal
Editorial Board: Steve Anglin, Ewan Buckingham, Tony Campbell, Gary Cornell, Jonathan Gennick,
Jason Gilmore, Kevin Goff, Jonathan Hassell, Matthew Moodie, Joseph Ottinger, Jeffrey Pepper,
Ben Renow-Clarke, Dominic Shakeshaft, Matt Wade, Tom Welsh
Project Manager: Richard Dal Porto
Copy Editor: Nicole Abramowitz
Associate Production Director: Kari Brooks-Copony
Production Editor: Janet Vail
Compositor: Linda Weidemann, Wolf Creek Press
Proofreader: Linda Seifert
Indexer: Toma Mulligan, Book Indexers
Artist: April Milne
Cover Designer: Kurt Krames
Manufacturing Director: Tom Debolski
Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor,
New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail orders-ny@springer-sbm.com, or
visit http://www.springeronline.com.
For information on translations, please contact Apress directly at 2855 Telegraph Avenue, Suite 600,
Berkeley, CA 94705. Phone 510-549-5930, fax 510-549-5939, e-mail info@apress.com, or visit
http://www.apress.com.
The information in this book is distributed on an “as is” basis, without warranty. Although every pre-
caution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any
liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly
or indirectly by the information contained in this work.
The source code for this book is available to readers at http://www.apress.com.
9047fmfinal.qxd 10/26/07 8:53 PM Page iii

Contents at a Glance

About the Authors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii


About the Technical Reviewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi

■CHAPTER 1 Introducing JavaServer Pages and Tomcat . . . . . . . . . . . . . . . . . . . . . . 1


■CHAPTER 2 JSP Explained . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
■CHAPTER 3 The Web Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
■CHAPTER 4 Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
■CHAPTER 5 At Face Value (JSF Primer) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
■CHAPTER 6 Communicating with XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
■CHAPTER 7 Tomcat 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
■CHAPTER 8 Eshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
■APPENDIX A Installing Everything . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
■APPENDIX B HTML Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
■APPENDIX C HTML Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
■APPENDIX D JSP Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
■APPENDIX E SQL Quick Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
■APPENDIX F JSF Quick Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
■APPENDIX G Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
■APPENDIX H Abbreviations and Acronyms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415

■INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419

iii
9047fmfinal.qxd 10/26/07 8:53 PM Page iv
9047fmfinal.qxd 10/26/07 8:53 PM Page v

Contents

About the Authors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii


About the Technical Reviewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi

■CHAPTER 1 Introducing JavaServer Pages and Tomcat . . . . . . . . . . . . . . . . 1


What Is JSP? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Viewing a Web Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Viewing a JSP Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Hello World! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
JSP Application Architectures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
The Model 1 Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
The Model 2 Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
What Role Does Tomcat Play in All This? . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

■CHAPTER 2 JSP Explained . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25


Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Scripting Elements and Java . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Data Types and Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Objects and Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Operators, Assignments, and Comparisons . . . . . . . . . . . . . . . . . . . . 29
Selections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Iterations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
The Online Bookshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Objects and Operations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
The Customer Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
The Eshop Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
The Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
The Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
The View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

v
9047fmfinal.qxd 10/26/07 8:53 PM Page vi

vi ■CONTENTS

Summary of JSP Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38


Implicit Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
JSP Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
JSP Standard Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Comments and Escape Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
JSP’s Tag Extension Mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Bodyless Custom Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Bodied Custom Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
JSTL and EL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
JSP Expression Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
JSP Standard Tag Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
The Core Library: Listing the Parameters . . . . . . . . . . . . . . . . . . . . . . 60
Other Core Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
The i18n Library: Writing Multilingual Applications . . . . . . . . . . . . . . 63
XML Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
XML Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72

■CHAPTER 3 The Web Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73


Web Pages in General. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
The Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
The Formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
More Bits and Pieces. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
URLs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Hosts and Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
GET and POST Requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
HTML Elements and Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Document Structure and Basic Elements . . . . . . . . . . . . . . . . . . . . . . 81
Content: Text, Objects, and Links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Cascading Style Sheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Style Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Placing Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Putting It All Together in an Example . . . . . . . . . . . . . . . . . . . . . . . . . . 96
9047fmfinal.qxd 10/26/07 8:53 PM Page vii

■CONTENTS vii

JavaScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Placing JavaScript Inside a Web Page . . . . . . . . . . . . . . . . . . . . . . . . 101
Responding to Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
Checking and Correcting Dates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Animation: Bouncing Balls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Animation: Ticker Tape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
What’s Ajax? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119

■CHAPTER 4 Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121


Database Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
SQL Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Java API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
Accessing Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
Transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
DB Access in Eshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
What About the XML Syntax? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Possible Alternatives to MySQL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143

■CHAPTER 5 At Face Value (JSF Primer) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145


The JSF Life Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
JSF Custom Tags. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Event Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
The JSF Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
f:view, h:form, and . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
f:subview, h:panelGroup, h:graphicImage . . . . . . . . . . . . . . . . . . . . . 153
h:panelGrid, h:inputText, and . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
The Shop Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
h:dataTable and h:column . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
f:facet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
h:message and f:verbatim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
Using and Creating Converters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Writing the Converter in Java . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
Registering the Converter with the Application . . . . . . . . . . . . . . . . 164
Using the Converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
9047fmfinal.qxd 10/26/07 8:53 PM Page viii

viii ■CONTENTS

Using and Creating Validators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164


Built-In Validators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Application-Level Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
Custom Validators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Validation Methods in Backing Beans . . . . . . . . . . . . . . . . . . . . . . . . 169
Creating Custom Components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
Renderer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
Tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
Inline Renderer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
web.xml. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
faces-config.xml . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180

■CHAPTER 6 Communicating with XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181


The XML Document. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Defining Your Own XML Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
XML DTDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
XML Schemas. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
XSL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
Example 1: Transformation from One XML Format to Another . . . 198
Example 2: Transformation from XML to HTML . . . . . . . . . . . . . . . . 200
Browser Side vs. Server Side. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
SOAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210

■CHAPTER 7 Tomcat 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211


Tomcat’s Architecture and server.xml . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Context. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
Connector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
Host . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
Engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Listener . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Global Naming Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
9047fmfinal.qxd 10/26/07 8:53 PM Page ix

■CONTENTS ix

Realm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Cluster . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Valve. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Loader and Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
Directory Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
conf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
lib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
webapps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
ROOT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Example: Logging the Requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Example: Tomcat on Port 80 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
Example: Creating a Virtual Host . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
Example: HTTPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
Application Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228

■CHAPTER 8 Eshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229


The Eshop Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
What Happens When the Application Starts . . . . . . . . . . . . . . . . . . . 231
Handling Requests for Book Selection and Book Search . . . . . . . . 234
Displaying the Book Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
Managing the Shopping Cart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Accepting an Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
Providing the Payment Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
The Eshopx Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
Style Sheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
web.xml . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
JSP Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
Custom Tags and TLD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
The Eshopf Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
web.xml and context.xml . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
Style Sheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
JSP Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
Java Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
9047fmfinal.qxd 10/26/07 8:53 PM Page x

x ■CONTENTS

■APPENDIX A Installing Everything . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251


Java . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
Tomcat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
MySQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
JDBC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
MySQL Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
Tomcat and MySQL Checks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
JSTL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
XPath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
JavaServer Faces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264

■APPENDIX B HTML Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265

■APPENDIX C HTML Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273


Standard Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
Core Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
Language Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
Keyboard Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
Document Structure and Information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
<!— ... —> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
<base> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
<body> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
<br/> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
<h1> to <h6> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
<head> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
<hr/> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
<html> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
<meta/> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
<p> and <p/> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
<title> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
Character Formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
<bdo> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
<pre> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
<sub>, <sup> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
9047fmfinal.qxd 10/26/07 8:53 PM Page xi

■CONTENTS xi

Character Styling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277


<b>, <strong>. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
<big> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
<cite>, <dfn>, <em>, <i>, <var> . . . . . . . . . . . . . . . . . . . . . . . . . . 278
<code>, <kbd>, <samp>, <tt> . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
<small> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
<abbr> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
<acronym> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
<address> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
<blockquote> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
<del> and <ins> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
<q> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
Links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
<a> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
<link/>. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
<frame> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
<frameset> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
<noframes> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
<iframe> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
The <form> element. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
Text Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
Buttons and Images. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
Choices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
Selections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
Sets of Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
The <img> element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
More on Image Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
9047fmfinal.qxd 10/26/07 8:53 PM Page xii

xii ■CONTENTS

Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
Standard Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
Table Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
<table> Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
Rows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
Cells . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
Column Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
Table Header, Body, and Footer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
<div> and <span> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
<style> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
<object> and <param> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
<script> and <noscript> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313

■APPENDIX D JSP Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315


Object Scopes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
Implicit Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
The application Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
The config Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
The exception Object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
The out Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
The pageContext Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
The request Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
The response Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
The session Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
Standard Directive Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
The page Directive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
The include Directive. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
The taglib Directive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
Standard Action Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
jsp:element, jsp:attribute, and jsp:body . . . . . . . . . . . . . . . . . . . . . . . 335
jsp:forward and jsp:param . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
jsp:include . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
jsp:plugin, jsp:params, and jsp:fallback . . . . . . . . . . . . . . . . . . . . . . 338
jsp:text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
jsp:useBean, jsp:getProperty, and jsp:setProperty . . . . . . . . . . . . . 340
XPath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
9047fmfinal.qxd 10/26/07 8:53 PM Page xiii

■CONTENTS xiii

Scripting Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345


Scriptlets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
Declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345

■APPENDIX E SQL Quick Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347

SQL Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347


Transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
The WHERE Condition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
SELECT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
CREATE DATABASE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
CREATE TABLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
CREATE INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
CREATE VIEW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
INSERT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
DROP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
DELETE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
ALTER TABLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
UPDATE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
SET TRANSACTION and START TRANSACTION. . . . . . . . . . . . . . . . . 368
COMMIT and ROLLBACK. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
Reserved SQL Keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368

■APPENDIX F JSF Quick Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371


JSF core Tag Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
f:actionListener. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
f:attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
f:converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
f:convertDateTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
f:convertNumber . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
f:facet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
f:loadBundle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
f:parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
f:phaseListener. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
f:selectItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
f:selectItems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
Random documents with unrelated
content Scribd suggests to you:
charcoal. A filter thus formed will last a considerable time, and will
be found particularly useful in removing noxious and putrescent
substances held in solution by water.”
The “portable filters,” in stoneware, that are commonly sold in the
shops, contain a stratum of sand, or coarsely powdered charcoal;
before, however, having access to this, the water has to pass
through a sponge, to remove the coarser portion of the impurities.
Alum Process Of Water Purification.—Water may be filtered
and purified by precipitation, by means of alum, by adding a 4 per
cent solution to the water to be clarified until a precipitate is no
longer produced. After allowing the turbid mixture to stand for 8
hours, the clear portion may be decanted or be siphoned off. About
2 grains of alum is ordinarily required to purify a gallon of water.
Potassa alum only should be used, as ammonia alum cannot be used
for this purpose. The amount of alum required varies with the water,
so that an initial experiment is required whenever water from a new
source is being purified. If the purification is properly done, the
water will not contain any alum, but only a trace of potassium
sulphate, for the aluminum of the double sulphate unites with the
various impurities to form an insoluble compound which gradually
settles out, mechanically carrying with it suspended matter, while the
sulphuric acid radical unites with the calcium in the water to form
insoluble calcium sulphate.
FILTER PAPER: See Paper.
FILM-STRIPPING: See Photography.
FINGER-TIPS, SPARKS FROM: See Pyrotechnics.
FIRES, COLORED: See Pyrotechnics.
FIREARM LUBRICANTS: See Lubricants.

FIRE EXTINGUISHERS:
I.— Calcium chloride 184 parts
Magnesium chloride 57 parts
Sodium chloride 13 parts
Potassium bromide 22 parts
Barium chloride 3 parts
Water to make 1,000 parts
Dissolve and fill into hand grenades.
II.— Iron sulphate 4 parts
Ammonium sulphate 16 parts
Water 100 parts
Mix, dissolve, and fill into flasks.
III.— Sodium chloride 430 parts
Alum 195 parts
Glauber salts 50 parts
Sodium carbonate, impure 35 parts
Water glass 266 parts
Water 233 parts
Mix, etc.
IV.— Sodium chloride 90 parts
Ammonium chloride 45 parts
Water 300 parts
Mix, dissolve, and put into quart flasks of very thin glass, which
are to be kept conveniently disposed in the dwelling rooms, etc., of
all public institutions.
V.—Make 6 solutions as follows:
a. — Ammonium chloride 20 parts
Water 2,000 parts
b. — Alum, calcined and
35 parts
powdered
Water 1,000 parts
c. — Ammonium sulphate,
30 parts
powdered
Water 500 parts
d. — Sodium chloride 20 parts
Water 4,000 parts
e. — Sodium carbonate 35 parts
Water 500 parts
f.— Liquid water glass 450 parts
{341}
Mix the solutions in the order named and to the mixture, while still
yellow and turbid, add 2,000 parts of water, and let stand. When the
precipitate has subsided fill off the clear liquid into thin glass
(preferably blue, to deter decomposition) containers each of 3 pints
to a half gallon capacity.
VI.— Calcium chloride 30 parts
Magnesium chloride 10 parts
Water 60 parts
VII.— Sodium chloride 20 parts
Ammonium chloride 9 parts
Water 71 parts
VIII.— Sodium carbonate 16 parts
Sodium chloride 64 parts
Water 920 parts
The most effective of all extinguishers is ammonia water. It is
almost instantaneous in its effect, and a small quantity only is
required to extinguish any fire. Next in value is carbonic acid gas.
This may be thrown from siphons or soda-water tanks. The vessel
containing it should be thrown into the fire in such a way as to
insure its breaking.
Dry Powder Fire Extinguishers.—The efficacy of these is
doubted by good authorities. They should be tested before adoption.
I.— Alum 24 parts
Ammonium sulphate 52 parts
Ferrous sulphate 4 parts
II.— Sodium chloride 8 parts
Sodium bicarbonate 6 parts
Sodium sulphate 2 parts
Calcium chloride 2 parts
Sodium silicate 2 parts
III.— Sodium chloride 6 parts
Ammonium chloride 6 parts
Sodium bicarbonate 8 parts
IV.— Ammonium chloride 10 parts
Sodium sulphate 6 parts
Sodium bicarbonate 4 parts
Oil Extinguisher.—To extinguish oils which have taken fire, a
fine-meshed wire net of the size of a boiling pan should be kept on
hand in every varnish factory, etc. In the same moment when the
netting is laid upon the burning surface, the flame is extinguished
because it is a glowing mass of gas, which the iron wire quickly cools
off so that it cannot glow any more. The use of water is excluded,
and that of earth and sand undesirable, because both dirty the oil.
Substitute For Fire Grenades.—A common quart bottle filled
with a saturated solution of common salt makes a cheap and
efficient substitute for the ordinary hand grenade. The salt forms a
coating on all that the water touches and makes it nearly
incombustible.
FIREPROOFING
For Textiles.—I.—Up to the present this has generally been
accomplished by the use of a combination of water glass or soluble
glass and tungstate of soda. The following is cheaper and more
suitable for the purpose:
Equal parts, by weight, of commercial white copperas, Epsom salt,
and sal ammoniac are mingled together and mixed with three times
their weight of ammonia alum. This mixture soon changes into a
moist pulp or paste, that must be dried by a low heat. When
dressing the material, add 1/2 part of this combination to every 1
part of starch.
II.—Good results are also obtained from the following formula:
Supersaturate a quantity of superphosphate of lime with ammonia,
filter, and decolorize it with animal charcoal. Concentrate the solution
and mix with it 5 per cent of gelatinous silica, evaporate the water,
dry, and pulverize. For use mix 30 parts of this powder with 35 parts
of gum and 35 parts of starch in sufficient water to make of suitable
consistency.
III.—As a sample of the Melunay process, introduced in France,
the following has been published: Apply to a cotton fabric like
flannellet, or other cotton goods, a solution of stannate of soda (or a
salt chemically equivalent) of the strength of 5 to 10° Bé., then dry
the fabric and saturate it again, this time with a solution of a
titanium salt; any soluble titanium salt is suitable. This salt should be
so concentrated that each 1,000 parts may contain about 62 parts of
titanium oxide. The fabrics are again dried, and the titanium is
ultimately fixed by means of a suitable alkaline bath. It is
advantageous to employ for this purpose a solution of silicate of
soda of about 14° Bé., but a mixed bath, composed of tungstate of
soda and ammonium chloride, may be employed. The objects are
afterwards washed, dried, and finished as necessary for trade. A
variation consists in treating the objects in a mixed bath containing
titanium, tungsten, and a suitable solvent.
IV.—Boil together, with constant {342} stirring, the following
ingredients until a homogeneous mass results:
Linseed oil 77 parts
Litharge 10 parts
Sugar of lead 2 parts
Lampblack 4 parts
Oil turpentine 2 parts
Umber 0.4 parts
Japanese wax 0.3 parts
Soap powder 1.2 parts
Manila copal 0.7 parts
Caoutchouc varnish 2 parts
V.—For Light Woven Fabrics.—Ammonium sulphate, 8 parts, by
weight; ammonium carbonate, 2.5 parts; borax, 2; boracic acid, 3;
starch, 2; or dextrin, 0.4, or gelatin, 0.4; water, 100. The fabric is to
be saturated with the mixture, previously heated to 86° F., and
dried; it can then be calendered in the ordinary way. The cost is only
2 or 3 cents for 16 yards or more of material.
VI.—For Rope and Straw Matting.—Ammonium chloride (sal
ammoniac), 15 parts, by weight; boracic acid, 6 parts; borax, 3;
water, 100. The articles are to be left in the solution, heated to
212° F. for about 3 hours, then squeezed out and dried. The mixture
costs about 5 cents a quart.
VII.—For Clothing.—The following starch is recommended: Sodium
tungstate, perfectly neutral, 30 parts; borax, 20; wheat or rice
starch, 60. The constituents are to be finely pulverized, sharply
dried, and mixed, and the starch used like any other. Articles
stiffened with it, if set on fire, will not burst into flame, but only
smolder.
VIII.—For Tents.—
Water 100 parts by weight
Ammonium sulphate,
14 parts by weight
chemically pure
Boracic acid 1 parts by weight
Hartshorn salt 1 parts by weight
Borax 3 parts by weight
Glue water 2 parts by weight
Boil the water, put ammonium sulphate into a vat, pour a part of
the boiling water on and then add the remaining materials in
rotation. Next follow the rest of the hot water. The vat should be
kept covered until the solution is complete.
IX.—For Stage Decorations.—Much recommended and used as a
fireproofing composition is a cheap mixture of borax, bitter salt, and
water; likewise for canvas a mixture of ammonium sulphate,
gypsum, and water. Ammonium sulphate and sodium tungstate are
also named for impregnating the canvas before painting.
X.—For Mosquito Netting.—Immerse in a 20 per cent solution of
ammonium sulphate. One pound of netting will require from 20 to
24 ounces of the solution to thoroughly saturate. After withdrawing
from the bath, do not wring it out, but spread it over a pole or some
such object, and let it get about half dry, then iron it out with a hot
iron. The material (ammonium sulphate) is inoffensive.
Fireproofing Of Wood.—Strictly speaking, it is impossible to
render wood completely incombustible, but an almost absolute
immunity against the attacks of fire can be imparted.
Gay-Lussac was one of the first to lay down the principal
conditions indispensable for rendering organic matters in general,
and wood in particular, uninflammable.
During the whole duration of the action of the heat the fibers must
be kept from contact with the air, which would cause combustion.
The presence of borates, silicates, etc., imparts this property to
organic bodies.
Combustible gases, disengaged by the action of the heat, must be
mingled in sufficient proportion with other gases difficult of
combustion in such a way that the disorganization of bodies by heat
will be reduced to a simple calcination without production of flame.
Salts volatile or decomposable by heat and not combustible, like
certain ammoniacal salts, afford excellent results.
Numerous processes have been recommended for combating the
inflammability of organic tissues, some consisting in external
applications, others in injection, under a certain pressure, of saline
solutions.
By simple superficial applications only illusory protection is
attained, for these coverings, instead of fireproofing the objects on
which they are applied, preserve them only for the moment from a
slight flame. Resistance to the fire being of only short duration,
these coatings scale off or are rapidly reduced to ashes and the
parts covered are again exposed. It often happens, too, that such
coatings have disappeared before the occurrence of a fire, so that
the so-called remedy becomes injurious from the false security
occasioned. {343}
Some formulas recommended are as follows:
I.—For immersion or imbibition the following solution is advised:
Ammonium phosphate, 100 parts; boracic acid, 10 parts per 1,000;
or ammonium sulphate, 135 parts; sodium borate, 15 parts; boracic
acid, 5 parts per 1,000. For each of these formulas two coats are
necessary.
II.—For application with the brush the following compositions are
the best:
a. Apply hot, sodium silicate, 100 parts; Spanish white, 50 parts;
glue, 100 parts.
b. Apply successively and hot; for first application, water, 100
parts; aluminum sulphate, 20 parts; second application, water, 100
parts; liquid sodium silicate, 50 parts.
c. First application, 2 coats, hot; water, 100 parts; sodium silicate,
50 parts; second application, 2 coatings; boiling water, 75 parts;
gelatin, white, 200 parts; work up with asbestos, 50 parts; borax, 30
parts; and boracic acid, 10 parts.
Oil paints rendered uninflammable by the addition of phosphate of
ammonia and borax in the form of impalpable powders incorporated
in the mass, mortar of plaster and asbestos and asbestos paint, are
still employed for preserving temporarily from limited exposure to a
fire.
III.— Sodium silicate, solid 350 parts
Asbestos, powdered 350 parts
Water, boiling 1,000 parts
Mix. Give several coatings, letting each dry
before applying the next.
IV.— Asbestos, powdered 35 parts
Sodium borate 20 parts
Water 100 parts
Gum lac 10 to 15 parts
Dissolve the borax in the water by the aid of heat, and in the hot
solution dissolve the lac. When solution is complete incorporate the
asbestos. These last solutions give a superficial protection, the
efficiency of which depends upon the number of coatings given.
V.—Prepare a syrupy solution of sodium silicate, 1 part, and water,
3 parts, and coat the wood 2 to 3 times, thus imparting to it great
hardness. After drying, it is given a coating of lime of the
consistency of milk, and when this is almost dry, is fixed by a strong
solution of soluble glass, 2 parts of the syrupy mass to 3 parts of
water. If the lime is applied thick, repeat the treatment with the
soluble glass.
VI.—Subject the wood or wooden objects for 6 to 8 hours to the
boiling heat of a solution of 33 parts of manganese chloride, 20
parts of orthophosphoric acid, 12 parts of magnesium carbonate, 10
parts of boracic acid, and 25 parts of ammonium chloride in 1,000
parts of water. The wood thus treated is said to be perfectly
incombustible even at great heat, and, besides, to be also protected
by this method against decay, injury by insects, and putrefaction.
VII.—One of the simplest methods is to saturate the timber with a
solution of tungstate of soda; if this is done in a vacuum chamber,
by means of which the wood is partly deprived of the air contained
in its cells, a very satisfactory result will be obtained. Payne’s process
consists in treating wood under these conditions first with solution of
sulphate of iron, and then with chloride of calcium; calcium sulphate
is thus precipitated in the tissues of the timber, which is rendered
incombustible and much more durable. There are several other
methods besides these, phosphate of ammonia and tungstate being
most useful. A coat of common whitewash is an excellent means of
lessening the combustibility of soft wood.
Fireproofing Wood Pulp.—The pulp is introduced into a boiler
containing a hot solution of sulphate and phosphate of ammonia and
provided with a stirring and mixing apparatus, as well as with an
arrangement for regulating the temperature. After treatment, the
pulp is taken out and compressed in order to free it from its
humidity. When dry, it may be used for the manufacture of paper or
for analogous purposes. Sawdust treated in the same manner may
be used for packing goods, for deadening walls, and as a jacketing
for steam pipes.
Fireproofing For Wood, Straw, Textiles, Etc.—The material to
be made fireproof is treated with a solution of 10 to 20 parts of
potassium carbonate and 4 to 8 parts of ammonium borate in 100
parts of water. Wherever excessive heat occurs, this compound,
which covers the substance, is formed into a glassy mass, thus
protecting the stuff from burning; at the same time a considerable
amount of carbonic acid is given off, which smothers the flames.
{344}
Miscellaneous Formulas For Fireproofing.
I.—In coating steel or other furnaces, first brush over the
brickwork to be covered a solution made by boiling 1 pound each of
silicate of soda and alum in 4 gallons of water, and follow
immediately with composition:
Silica 50 parts
Plastic fire clay 10 parts
Ball clay 3 parts
Mix well.
Fireproof Compositions.—II.—For furnaces, etc.:
Pure silica (in grain) 60 parts
Ground flint 8 parts
Plaster of Paris 3 parts
Ball clay 3 parts
Mix well together by passing once or more through a fine sieve,
and use in the same way as cement.
Fireproof Paper.—Paper is rendered fireproof by saturating it with
a solution of
Ammonium sulphate 8 parts
Boracic acid 3 parts
Borax 2 parts
Water 100 parts
For the same purpose sodium tungstate may also be employed.
Fireproof Coating.—A fireproof coating (so-called) consists of
water, 100 parts; strong glue, 20 parts; silicate of soda, 38° Bé., 50
parts; carbonate of soda, 35 parts; cork in pieces of the size of a
pea, 100 parts.
Colored Fireproofing.—I.—Ammonium sulphate, 70 parts; borax,
50 parts; glue, 1 part; and water up to 1,000 parts.
II.—Solution of glue, 5 parts, zinc chloride, 2 parts; sal ammoniac,
80 parts; borax, 57 parts; and water up to 700 parts.
If the coating is to be made visible by coloration, an addition of 10
parts of Cassel brown and 6 parts of soda per 1,000 parts is
recommended, which may be dissolved separately in a portion of the
water used.
FIREPROOFING CELLULOID: See Celluloid.
FIREPROOFING OF PAPER: See Paper.
FIREWORKS: See Pyrotechnics.
FILIGREE GILDING: See Plating.

FISH BAIT.
Oil of rhodium 3 parts
Oil of cumin 2 parts
Tincture of musk 1 part
Mix. Put a drop or two on the bait, or rub trigger of trap with the
solution.

FIXATIVES FOR CRAYON DRAWINGS, ETC.


I.— 40 parts by
Shellac
weight
20 parts by
Sandarac
weight
940 parts by
Spirit of wine
weight
II.—During the Civil War, when both alcohol and shellac often
were not purchasable, and where, in the field especially, ink was
almost unknown, and sized paper, of any description, a rarity, men in
the field were compelled to use the pencil for correspondence of all
sorts. Where the communication was of a nature to make its
permanency desirable, the paper was simply dipped in skim milk,
which effected the purpose admirably. Such documents written with
a pencil on unsized paper have stood the wear and rubbing of
upward of 40 years.
To Fix Pounced Designs.—Take beer or milk or alcohol, in which a
little bleached shellac has been dissolved, and blow one of these
liquids upon the freshly pounced design by means of an atomizer.
After drying, the drawing will have the desired fixedness.
FIXING BATHS FOR PAPER AND NEGATIVES: See Photography.
FLANNELS, WHITENING OF: See Laundry Preparations.
FLASH-LIGHT APPARATUS AND POWDERS: See Photography.
FLAVORINGS: See Condiments.
FLEA DESTROYERS: See Insecticides.
FLIES IN THE HOUSE: See Household Formulas.
FLIES AND PAINT: See Paint.

FLOOR DRESSINGS
(See also Paint, Polishes, Waxes, and Wood.)
Oil Stains For Hard Floors.—I.—Burnt sienna, slate brown, or
wine black, is ground with strong oil varnish in the paint mill. The
glazing color obtained {345} is thinned with a mixture of oil of
turpentine and applied with a brush on the respective object. The
superfluous stain is at once wiped away with a rag, so that only the
absorbed stain remains in the wood. If this is uneven, go over the
light places again with dark stain. In a similar manner all otherwise
tinted and colored oil stains are produced by merely grinding the
respective color with the corresponding addition of oil. Thus, green,
red, and even blue and violet shades on wood can be obtained, it
being necessary only to make a previous experiment with the stains
on a piece of suitable wood. In the case of soft wood, however, it is
advisable to stain the whole previously with ordinary nut stain (not
too dark), and only after drying to coat with oil stain, because the
autumn rings of the wood take no color, and would appear too light,
and, therefore, disturb the effect.
II.—Boil 25 parts, by weight, of fustic and 12 parts of Brazil wood
with 2,400 parts of soapmakers’ lye and 12 parts of potash, until the
liquid measures about 12 quarts. Dissolve in it, while warm, 30 parts
of annatto and 75 of wax, and stir until cold. There will be a
sufficient quantity of the brownish-red stain to keep the floor of a
large room in good order for a year. The floor should be swept with
a brush broom daily, and wiped up twice a week with a damp cloth,
applying the stain, when necessary, to places where there is much
wear, and rubbing it in with a hard brush. Every 6 weeks put the
stain all over the floor, and brush it in well.
III.— Neatsfoot oil 1 part
Cottonseed oil 1 part
Petroleum oil 1 part
IV.— Beeswax 8 parts
Water 56 parts
Potassium carbonate 4 parts
Dissolve the potash in 12 parts of water; heat together the wax
and the remaining water till the wax is liquefied; then mix the two
and boil together until a perfect emulsion is effected. Color, if
desired, with a solution of annatto.
V.— Paraffine oil 8 parts
Kerosene 1 part
Limewater 1 part
Mix thoroughly. A coat of the mixture is applied to the floor with a
mop.
Paraffining Of Floors.—The cracks and joints of the parquet
floor are filled with a putty consisting of Spanish white, 540 parts;
glue, 180 parts; sienna, 150 parts; umber, 110 parts; and calcareous
earth, 20 parts. After 48 hours apply the paraffine, which is
previously dissolved in petroleum, or preferably employed in a
boiling condition, in which case it will enter slightly into the floor.
When solidification sets in, the superfluous paraffine is scratched off
and an even, smooth surface of glossy color results, which
withstands acids and alkalies.
Ball-Room Floor Powder.—
Hard paraffine 1 pound
Powdered boric acid 7 pounds
Oil lavender 1 drachm
Oil neroli 20 minims
Melt the paraffine and add the boric acid and the perfumes. Mix
well, and sift through a 1/16 mesh sieve.
Renovating Old Parquet Floors.—Caustic soda lye, prepared
by boiling for 45 minutes with 1 part calcined soda, and 1 part
slaked lime with 15 parts water, in a cast-iron pot, is applied to the
parquet to be renovated by means of a cloth attached to a stick.
After a while rub off the floor with a stiff brush, fine sand, and a
sufficient quantity of water, to remove the dirt and old wax. Spread a
mixture of concentrated sulphuric acid and water in the proportion of
1 to 8 on the floor. The sulphuric acid will remove the particles of
dirt and wax which have entered the floor and enliven the color of
the wood. Finally, wax the parquet after it has been washed off with
water and dried completely.
FLOOR OIL: See Oils.
FLOOR PAPER: See Paper.
FLOOR POLISH: See Polishes.
FLOOR VARNISHES: See Varnishes.
FLOOR WATERPROOFING: See Waterproofing.
FLOOR WAX: See Waxes.
FLORICIN OIL: See Oil.
FLOWER PRESERVATIVES.
I.—To preserve flowers they should be dipped in melted paraffine,
which should be just hot enough to maintain its fluidity. The flowers
should be dipped one at a time, held by the stalks and moved about
for an instant to get rid of air bubbles. Fresh cut flowers, free from
moisture, {346} are said to make excellent specimens when treated in
this way. A solution in which cut flowers may be kept immersed is
made as follows:
Salicylic acid 20 grains
Formaldehyde 10 minims
Alcohol 2 fluidounces
Distilled water 1 quart
II.—The English method of preserving flowers so as to retain their
form and color is to imbed the plants in a mixture of equal quantities
of plaster of Paris and lime, and gradually heat them to a
temperature of 100° F. After this the flower looks dusty, but if it is
laid aside for an hour so as to absorb sufficient moisture to destroy
its brittleness, it can be dusted without injury. To remove the hoary
appearance which is often left, even after dusting, a varnish
composed of 5 ounces of dammar and 16 ounces of oil of turpentine
should be used and a second coat given if necessary. When the gum
has been dissolved in the turpentine, 16 ounces of benzoline should
be added, and the whole should be strained through fine muslin.
III.—Five hundred parts ether, 20 parts transparent copal, and 20
parts sand. The flowers should be immersed in the varnish for 2
minutes, then allowed to dry for 10 minutes, and this treatment
should be repeated 5 or 6 times.
IV.—Place the flowers in a solution of 30 grains of salicylic acid in
1 quart of water.
V.—Moisten 1,000 parts of fine white sand that has been
previously well washed and thoroughly dried and sifted, with a
solution consisting of 3 parts of stearine, 3 parts of paraffine, 3 parts
of salicylic acid, and 100 parts of alcohol. Work the sand up
thoroughly so that every grain of it is impregnated with the mixture,
and then spread it out and let it become perfectly dry. To use, place
the flowers in a suitable box, the bottom of which has been covered
with a portion of the prepared sand, and then dust the latter over
them until all the interstices have been completely filled with it.
Close the box lightly and put it in a place where it can be maintained
at a temperature of from 86° to 104° F. for 2 or 3 days. At the
expiration of this time remove the box and let the sand escape. The
flowers can then be put into suitable receptacles or glass cases
without fear of deterioration. Wilted or withered flowers should be
freshened up by dipping into a suitable aniline solution, which will
restore their color.
VI.—Stand the flowers upright in a box of proper size and pour
over and around them fine dry sand, until the flowers are completely
surrounded in every direction. Leave them in this way for 8 or 10
days, then carefully pour off the sand. The flowers retain their color
and shape perfectly, but in very fleshy, juicy specimens the sand
must be renewed. To be effective the sand must be as nearly dry as
possible.
VII.—A method of preserving cut flowers in a condition of
freshness is to dissolve small amounts of ammonium chloride,
potassium nitrate, sodium carbonate or camphor in the water into
which the stems are inserted. The presence of one or more of these
drugs keeps the flowers from losing their turgidity by stimulating the
cells to action and by opposing germ growth. Flowers that have
already wilted are said to revive quickly if the stems are inserted in a
weak camphor water.
Stuccoed Gypsum Flowers.—Take natural flowers, and coat the
lower sides of their petals and stamens with paraffine or with a
mixture of glue, gypsum, and lime, which is applied lightly. Very fine
parts of the flowers, such as stamens, etc., may be previously
supported by special attachments of textures, wire, etc. After the
drying of the coating the whole is covered with shellac solution or
with a mixture of glue, gypsum, lime with lead acetate, oil, mucilage,
glycerine, colophony, etc. If desired, the surface may be painted
with bronzes in various shades. Such flowers are much employed in
the shape of festoons for decorating walls, etc.
Artificial Coloring Of Flowers.—A method employed by florists
to impart a green color to the white petals of “carnation pinks”
consists in allowing long-stemmed flowers to stand in water
containing a green aniline dye. When the flowers are fresh they
absorb the fluid readily, and the dye is carried to the petals.
Where the original color of the flower is white, colored stripes can
be produced upon the petals by putting the cut ends into water
impregnated with a suitable aniline dye. Some dyes can thus be
taken up by the capillary action of the stem and deposited in the
tissue of the petal. If flowers are placed over a basin of water
containing a very small amount of ammonia in a bell glass, the
colors of the petals will generally show some marked change. Many
violet-colored flowers when so treated will become {347} green, and
if the petals contain several tints they will show greens where reds
were, yellows where they were white, and deep carmine will become
black. When such flowers are put into water they will retain their
changed colors for hours.
If violet asters are moistened with very dilute nitric acid, the ray
florets become red and acquire an agreeable odor.
FLUID MEASURES: See Weights and Measures.
FLUORESCENT LIQUIDS.
Æsculin gives pale blue by (1) reflected light, straw color by (2)
transmitted light.
Amido-phthalic acid, pale violet (1), pale yellow (2). Amido-
terephthalic acid, bright green (1), pale green (2).
Eosine, yellow green (1), orange (2).
Fluorescein, intense green (1), orange yellow (2).
Fraxin, blue green (1), pale green (2).
Magdala red, opaque scarlet (1), brilliant carmine (2).
Quinine, pale blue (1), no color (2).
Safranine, yellow red (1), crimson (2).
FLUXES USED IN ENAMELING: See Enameling.
FLUXES FOR SOLDERING: See Soldering.

FLY-PAPERS AND FLY-POISONS


(See also Insecticides.)
Sticky Fly-Papers.—The sticky material applied to the paper is
the following:
I.— Boiled linseed oil 5 to 7 parts
Gum thus 2 to 3 parts
Non-drying oil 3 to 7 parts
For the non-drying oil, cottonseed, castor, or neatsfoot will answer
—in fact, any of the cheaper oils that do not readily dry or harden
will answer. The proper amount of each ingredient depends upon the
condition of the boiled oil. If it is boiled down very stiff, more of the
other ingredients will be necessary, while if thin, less will be
required.
II.— Rosin 8 parts
Rapeseed oil 4 parts
Honey 1 part
Melt the rosin and oil together, and incorporate the honey. Two
parts of raw linseed oil and 2 parts of honey may be used along with
8 parts of rosin instead of the foregoing. Use paper already sized, as
it comes from the mills, on which to spread the mixture.
III.— Castor oil 12 ounces
Rosin 27 ounces
Melt together and spread on paper sized with glue, using 12
ounces glue to 4 pints water.
IV.— Rosin 8 ounces
Venice turpentine 2 ounces
Castor oil 2 ounces
Spread on paper sized with glue.
Poisonous Fly-Papers.—
I.— Quassia chips 150 parts
Chloride of cobalt 10 parts
Tartar emetic 2 parts
Tincture of long pepper (1
80 parts
to 4)
Water 400 parts
Boil the quassia in the water until the liquid is reduced one-half,
strain, add the other ingredients, saturate common absorbent paper
with the solution, and dry. The paper is used in the ordinary way.
II.— Potassium bichromate 10 ounces
Sugar 3 drachms
Oil of black pepper 2 drachms
Alcohol 2 ounces
Water 14 ounces
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookultra.com

You might also like