100% found this document useful (4 votes)
39 views

Complete Guide To Web Development With Java - Understanding Website Creation 2nd Edition Tim Downey PDF For All Chapters

Java

Uploaded by

nganguguemri
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (4 votes)
39 views

Complete Guide To Web Development With Java - Understanding Website Creation 2nd Edition Tim Downey PDF For All Chapters

Java

Uploaded by

nganguguemri
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 62

Download the full version of the textbook now at textbookfull.

com

Guide to Web Development with Java -


Understanding Website Creation 2nd Edition
Tim Downey

https://textbookfull.com/product/guide-to-web-
development-with-java-understanding-website-
creation-2nd-edition-tim-downey/

Explore and download more textbook at https://textbookfull.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Learn Java for Web Development Modern Java Web Development


Layka Vishal

https://textbookfull.com/product/learn-java-for-web-development-
modern-java-web-development-layka-vishal/

textbookfull.com

Website Hosting and Migration with Amazon Web Services: A


Practical Guide to Moving Your Website to AWS 1st Edition
Jason Nadon (Auth.)
https://textbookfull.com/product/website-hosting-and-migration-with-
amazon-web-services-a-practical-guide-to-moving-your-website-to-
aws-1st-edition-jason-nadon-auth/
textbookfull.com

Web Development for beginners Learn HTML CSS Javascript


step by step with this Coding Guide Programming Guide for
beginners Website development 1st Edition Mastery
https://textbookfull.com/product/web-development-for-beginners-learn-
html-css-javascript-step-by-step-with-this-coding-guide-programming-
guide-for-beginners-website-development-1st-edition-mastery/
textbookfull.com

Physiologically-based Pharmacokinetic Modeling: Methods


and Applications in Toxicology and Risk Assessment 1st
Edition Jeffrey Fisher (Editor)
https://textbookfull.com/product/physiologically-based-
pharmacokinetic-modeling-methods-and-applications-in-toxicology-and-
risk-assessment-1st-edition-jeffrey-fisher-editor/
textbookfull.com
Rocks and Rifles: The Influence of Geology on Combat and
Tactics during the American Civil War Scott Hippensteel

https://textbookfull.com/product/rocks-and-rifles-the-influence-of-
geology-on-combat-and-tactics-during-the-american-civil-war-scott-
hippensteel/
textbookfull.com

Environmental and Social economic Impacts of Sewage Sludge


Treatment The Evidence of Beijing 1st Edition Guofeng
Zhang (Auth.)
https://textbookfull.com/product/environmental-and-social-economic-
impacts-of-sewage-sludge-treatment-the-evidence-of-beijing-1st-
edition-guofeng-zhang-auth/
textbookfull.com

Vittorio Benussi in the History of Psychology New Ideas of


a Century Ago Mauro Antonelli

https://textbookfull.com/product/vittorio-benussi-in-the-history-of-
psychology-new-ideas-of-a-century-ago-mauro-antonelli/

textbookfull.com

The Routledge handbook of translation studies and


linguistics First Published. Edition Malmkjær

https://textbookfull.com/product/the-routledge-handbook-of-
translation-studies-and-linguistics-first-published-edition-malmkjaer/

textbookfull.com

Ten Laws for Security 1st Edition Eric Diehl (Auth.)

https://textbookfull.com/product/ten-laws-for-security-1st-edition-
eric-diehl-auth/

textbookfull.com
Human-Animal Relationships in San and Hunter-Gatherer
Cosmology, Volume I: Therianthropes and Transformation
Mathias Guenther
https://textbookfull.com/product/human-animal-relationships-in-san-
and-hunter-gatherer-cosmology-volume-i-therianthropes-and-
transformation-mathias-guenther/
textbookfull.com
Texts in Computer Science

Tim Downey

Guide to Web
Development
with Java
Understanding Website Creation
Second Edition
Texts in Computer Science

Series Editors
David Gries, Department of Computer Science, Cornell University, Ithaca, NY,
USA
Orit Hazzan , Faculty of Education in Technology and Science, Technion—Israel
Institute of Technology, Haifa, Israel
More information about this series at http://www.springer.com/series/3191
Tim Downey

Guide to Web
Development with Java
Understanding Website Creation
Second Edition

123
Tim Downey
School of Computing
and Information Sciences
Florida International University
Miami, FL, USA

ISSN 1868-0941 ISSN 1868-095X (electronic)


Texts in Computer Science
ISBN 978-3-030-62273-2 ISBN 978-3-030-62274-9 (eBook)
https://doi.org/10.1007/978-3-030-62274-9
1st edition: © Springer-Verlag London Limited 2012
2nd edition: © Springer Nature Switzerland AG 2021
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part
of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations,
recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission
or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar
methodology now known or hereafter developed.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this
publication does not imply, even in the absence of a specific statement, that such names are exempt from
the relevant protective laws and regulations and therefore free for general use.
The publisher, the authors and the editors are safe to assume that the advice and information in this
book are believed to be true and accurate at the date of publication. Neither the publisher nor the
authors or the editors give a warranty, expressed or implied, with respect to the material contained
herein or for any errors or omissions that may have been made. The publisher remains neutral with regard
to jurisdictional claims in published maps and institutional affiliations.

This Springer imprint is published by the registered company Springer Nature Switzerland AG
The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland
To Bobbi, my sweetheart, with all my love.
The magic continues.
Preface

This book is about developing web applications. Over the years, more and more
frameworks have appeared that hide the details of the communication between the
browser and the server. These packages are fantastic for developing applications,
but an understanding of the underlying process can help understand the reason that
frameworks do what they do.
In writing this book, I read the Spring documentation in detail and reviewed many
questions from Stack Overflow. The problems I encountered were that many sear-
ches did not return the most current version of documentation. Frequently, I had to
check that I wasn’t reading about version 1 features instead of version 5. Similarly,
many relevant answers to questions are buried deep in the search results, since older
answers have been around much longer and appear at the top of the search.
My hope is that this book will present material from the basics of HTML and
HTTP to the intricacies of web services in a step-by-step manner, adding only a few
details at a time. Some topics have multiple implementations that produce similar
results. I hope that the distinctions between these implementations are made clear.
The book develops a framework in the first few chapters and then switches to the
Spring framework for implementing websites. There are many frameworks on the
market. Spring is popular and Spring Boot is an excellent introductory package.
I want students to understand the actual details that a framework hides, and to use a
framework to solve problems. In the future, when they are introduced to other
frameworks, they will understand them better.
I am grateful to the community of web developers, who have provided all the
excellent tools for creating web applications: Apache, Tomcat, Hibernate, Java
Servlets, Java Server Pages, NetBeans, Eclipse, Log4j, Apache Commons, Google
web services, FedEx web services, PayPal web services, JBoss Community, Spring,
and Maven.
I am thankful to Bobbi, my sweetheart, for all of her love and support. Without
Bobbi, this book would not have been finished. I also want to thank Kip Irvine for
encouraging me to write. Without Kip, this book would not have been started.

Miami, USA Tim Downey

vii
Contents

1 Web Applications and Maven . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1


1.1 Hypertext Transfer Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1.1 Request Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1.2 Response Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1.3 Content Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2 Markup Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.1 Hypertext Markup Language . . . . . . . . . . . . . . . . . . . . 5
1.2.2 Basic Tags for a Web Page . . . . . . . . . . . . . . . . . . . . . 7
1.2.3 What is the HT in HTML? . . . . . . . . . . . . . . . . . . . . . 12
1.3 HTML Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.3.1 Form Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.3.2 Representing Data . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.3.3 Transmitting Data Over the Web . . . . . . . . . . . . . . . . . 19
1.4 Web Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.4.1 Directory Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.5 Maven . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1.5.1 Maven Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1.5.2 Maven Web Application . . . . . . . . . . . . . . . . . . . . . . . 22
1.5.3 Maven from the Command Line . . . . . . . . . . . . . . . . . 24
1.5.4 Maven in an IDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
1.5.5 Maven: Adding A Servlet Engine . . . . . . . . . . . . . . . . 26
1.6 Processing Form Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
1.6.1 JSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
1.6.2 Initialising Form Elements . . . . . . . . . . . . . . . . . . . . . 30
1.7 The Truth About JSPs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
1.7.1 Servlet for a JSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
1.7.2 Handling a JSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
1.8 Tomcat and IDEs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
1.8.1 Web Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
1.9 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
1.10 Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

ix
x Contents

2 Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
2.1 Sending Data to Another Form . . . . . . . . . . . . . . . . . . . . . . . . 46
2.1.1 Action Attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
2.1.2 Hidden Field Technique . . . . . . . . . . . . . . . . . . . . . . . 49
2.1.3 Sending Data to Either of Two Pages . . . . . . . . . . . . . 53
2.2 Using a Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
2.2.1 Controller Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
2.2.2 JSP Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
2.2.3 JSPs Versus Servlets . . . . . . . . . . . . . . . . . . . . . . . . . 65
2.2.4 Controller Servlet . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
2.2.5 Servlet Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
2.2.6 Servlet Directory Structure . . . . . . . . . . . . . . . . . . . . . 71
2.2.7 Servlet Engine for a Servlet . . . . . . . . . . . . . . . . . . . . 74
2.3 Maven Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
2.3.1 Automatic Deployment . . . . . . . . . . . . . . . . . . . . . . . . 75
2.3.2 Debugging Servlets . . . . . . . . . . . . . . . . . . . . . . . . . . 78
2.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
2.5 Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
3 Java Beans and Member Variables . . . . . . . . . . . . . . . . . . . . . . . . . 85
3.1 Application: Start Example . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
3.2 Java Bean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
3.2.1 Creating a Data Bean . . . . . . . . . . . . . . . . . . . . . . . . . 89
3.2.2 Using the Bean in a Web Application . . . . . . . . . . . . . 90
3.3 Application: Data Bean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
3.3.1 Mapping: Data Bean . . . . . . . . . . . . . . . . . . . . . . . . . . 92
3.3.2 Controller: Data Bean . . . . . . . . . . . . . . . . . . . . . . . . . 93
3.3.3 Data Access in a View . . . . . . . . . . . . . . . . . . . . . . . . 94
3.3.4 Views: Data Bean . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
3.4 Application: Default Validation . . . . . . . . . . . . . . . . . . . . . . . . 96
3.4.1 Java Bean: Default Validation . . . . . . . . . . . . . . . . . . . 96
3.4.2 Controller: Default Validation . . . . . . . . . . . . . . . . . . . 98
3.5 Member Variables in Servlets . . . . . . . . . . . . . . . . . . . . . . . . . 100
3.5.1 Threads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
3.5.2 The Problem with Member Variables . . . . . . . . . . . . . 100
3.5.3 Local Versus Member Variables . . . . . . . . . . . . . . . . . 103
3.6 Application: Shared Variable Error . . . . . . . . . . . . . . . . . . . . . 104
3.6.1 Controller: Shared Variable Error . . . . . . . . . . . . . . . . 104
3.7 Application: Restructured Controller . . . . . . . . . . . . . . . . . . . . 107
3.7.1 Creating the Helper Base . . . . . . . . . . . . . . . . . . . . . . 108
3.7.2 Creating the Controller Helper . . . . . . . . . . . . . . . . . . 109
3.7.3 Views: Restructured Controller . . . . . . . . . . . . . . . . . . 112
3.7.4 Controller: Restructured Controller . . . . . . . . . . . . . . . 114
Contents xi

3.7.5 Restructured Controller Analysis . . . . . . . . . . . . . . . . . 114


3.7.6 File Structure: Restructured Controller . . . . . . . . . . . . . 114
3.8 Model, View, Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
3.9 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
3.10 Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
4 Spring Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
4.1 Spring Boot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
4.1.1 Power of Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
4.1.2 Injection Through Autowiring . . . . . . . . . . . . . . . . . . . 123
4.2 Application: Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . 129
4.2.1 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
4.2.2 Command Line Arguments . . . . . . . . . . . . . . . . . . . . . 133
4.2.3 Main Class: Command Line . . . . . . . . . . . . . . . . . . . . 133
4.3 Application: Spring MVC . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
4.3.1 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
4.3.2 Servlets and Controllers . . . . . . . . . . . . . . . . . . . . . . . 137
4.3.3 Static Content Locations . . . . . . . . . . . . . . . . . . . . . . . 139
4.3.4 Location of the View Pages . . . . . . . . . . . . . . . . . . . . 139
4.3.5 Request Data Interface . . . . . . . . . . . . . . . . . . . . . . . . 144
4.3.6 Bean Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
4.3.7 Singleton Controllers . . . . . . . . . . . . . . . . . . . . . . . . . 149
4.3.8 Retrieving HTTP Variables . . . . . . . . . . . . . . . . . . . . . 150
4.4 Application: Spring Restructured Controller . . . . . . . . . . . . . . . 151
4.4.1 Modified Controller . . . . . . . . . . . . . . . . . . . . . . . . . . 152
4.5 Maven Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
4.5.1 Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
4.5.2 Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
4.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
4.7 Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
5 Spring MVC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
5.1 Eliminating Hidden Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
5.1.1 Session Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
5.1.2 Spring Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
5.1.3 Modifying the Controller . . . . . . . . . . . . . . . . . . . . . . 175
5.2 Controller Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
5.2.1 Encapsulating with Methods . . . . . . . . . . . . . . . . . . . . 179
5.2.2 Multiple Mappings . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
5.3 POST Requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
5.3.1 POST Versus GET . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
5.3.2 Using Post . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
xii Contents

5.4 Replacing the Request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188


5.4.1 Adding to the Model . . . . . . . . . . . . . . . . . . . . . . . . . 188
5.4.2 Model in a View . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
5.4.3 Model in a Controller . . . . . . . . . . . . . . . . . . . . . . . . . 191
5.5 Navigation Without the Query String . . . . . . . . . . . . . . . . . . . . 196
5.5.1 Using Path Info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
5.5.2 Default Request Mapping . . . . . . . . . . . . . . . . . . . . . . 198
5.6 Session Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
5.6.1 Class Annotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
5.6.2 Parameter Annotation . . . . . . . . . . . . . . . . . . . . . . . . . 200
5.6.3 Logical Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
5.6.4 Conversational Storage . . . . . . . . . . . . . . . . . . . . . . . . 204
5.6.5 Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
5.7 Logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
5.7.1 Logback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
5.7.2 Configuring the Logger . . . . . . . . . . . . . . . . . . . . . . . . 207
5.7.3 Retrieving the Logger . . . . . . . . . . . . . . . . . . . . . . . . . 211
5.7.4 Adding a Logger in the Bean . . . . . . . . . . . . . . . . . . . 212
5.8 Application: Enhanced Controller . . . . . . . . . . . . . . . . . . . . . . 213
5.8.1 Views: Enhanced Controller . . . . . . . . . . . . . . . . . . . . 214
5.8.2 Model: Enhanced Controller . . . . . . . . . . . . . . . . . . . . 216
5.8.3 Controller: Enhanced Controller . . . . . . . . . . . . . . . . . 218
5.9 Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
5.10 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
5.11 Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
6 Validation and Persistence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
6.1 Required Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
6.1.1 Regular Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . 228
6.1.2 Required Validation . . . . . . . . . . . . . . . . . . . . . . . . . . 232
6.2 Application: Required Validation . . . . . . . . . . . . . . . . . . . . . . . 240
6.2.1 Views: Required Validation . . . . . . . . . . . . . . . . . . . . 241
6.2.2 Model: Required Validation . . . . . . . . . . . . . . . . . . . . 242
6.2.3 Controller: Required Validation . . . . . . . . . . . . . . . . . . 243
6.3 Additional Binders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
6.3.1 Custom Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
6.3.2 Custom Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
6.4 Java Persistence API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
6.4.1 JPA Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
6.4.2 Persistent Annotations . . . . . . . . . . . . . . . . . . . . . . . . 256
6.4.3 Accessing the Database . . . . . . . . . . . . . . . . . . . . . . . 259
6.4.4 Data Persistence in Hibernate . . . . . . . . . . . . . . . . . . . 275
6.5 Application: Persistent Data . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
Contents xiii

6.5.1 Views: Persistent Data . . . . . . . . . . . . . . . . . . . . . . . . 277


6.5.2 Repository: Persistent Data . . . . . . . . . . . . . . . . . . . . . 278
6.5.3 Controller: Persistent Data . . . . . . . . . . . . . . . . . . . . . 278
6.6 Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
6.7 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
6.8 Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
7 Advanced HTML and Form Elements . . . . . . . . . . . . . . . . . . . . . . 287
7.1 Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
7.2 HTML Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
7.2.1 In-Line and Block Tags . . . . . . . . . . . . . . . . . . . . . . . 289
7.2.2 General Style Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
7.2.3 Layout Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
7.3 Cascading Style Sheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
7.3.1 Adding Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
7.3.2 Defining Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
7.3.3 Custom Layout with CSS . . . . . . . . . . . . . . . . . . . . . . 303
7.4 Form Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
7.4.1 Input Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
7.4.2 Textarea Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
7.4.3 Select Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
7.5 Spring Form Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
7.5.1 Spring Input Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
7.5.2 Spring Textarea Tag . . . . . . . . . . . . . . . . . . . . . . . . . . 315
7.5.3 Spring Select Elements . . . . . . . . . . . . . . . . . . . . . . . . 315
7.5.4 Initialising Form Elements . . . . . . . . . . . . . . . . . . . . . 316
7.6 Bean Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
7.6.1 Bean Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
7.6.2 Filling the Bean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
7.6.3 Accessing Multiple-Valued Properties . . . . . . . . . . . . . 319
7.7 Application: Complex Elements . . . . . . . . . . . . . . . . . . . . . . . . 320
7.7.1 Controller: Complex Elements . . . . . . . . . . . . . . . . . . . 320
7.7.2 Views: Complex Elements . . . . . . . . . . . . . . . . . . . . . 321
7.7.3 Model: Complex Elements . . . . . . . . . . . . . . . . . . . . . 324
7.8 Validating Multiple Choices . . . . . . . . . . . . . . . . . . . . . . . . . . 326
7.9 Application: Complex Validation . . . . . . . . . . . . . . . . . . . . . . . 327
7.9.1 Model: Complex Validation . . . . . . . . . . . . . . . . . . . . 327
7.9.2 Views: Complex Validation . . . . . . . . . . . . . . . . . . . . 328
7.9.3 Controller: Complex Validation . . . . . . . . . . . . . . . . . . 329
7.10 Saving Multiple Choices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
7.11 Application: Complex Persistent . . . . . . . . . . . . . . . . . . . . . . . 332
7.11.1 Model: Complex Persistent . . . . . . . . . . . . . . . . . . . . . 332
7.11.2 Views: Complex Persistent . . . . . . . . . . . . . . . . . . . . . 332
xiv Contents

7.11.3 Repository: Complex Persistent . . . . . . . . . . . . . . . . . . 333


7.11.4 Controller: Complex Persistent . . . . . . . . . . . . . . . . . . 334
7.12 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
7.13 Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
8 Accounts–Cookies–Carts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
8.1 Retrieving From The Database . . . . . . . . . . . . . . . . . . . . . . . . 344
8.1.1 Finding a Row . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
8.1.2 Validating a Single Property . . . . . . . . . . . . . . . . . . . . 346
8.1.3 Retrieving a Record . . . . . . . . . . . . . . . . . . . . . . . . . . 347
8.2 Application: Account Login . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
8.2.1 Model: Account Login . . . . . . . . . . . . . . . . . . . . . . . . 350
8.2.2 Views: Account Login . . . . . . . . . . . . . . . . . . . . . . . . 352
8.2.3 Controller: Account Login . . . . . . . . . . . . . . . . . . . . . 353
8.3 Removing Rows from the Database . . . . . . . . . . . . . . . . . . . . . 355
8.3.1 Delete Fragment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
8.3.2 Delete Repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
8.3.3 Controller: Delete Record . . . . . . . . . . . . . . . . . . . . . . 356
8.4 Application: Account Removal . . . . . . . . . . . . . . . . . . . . . . . . 357
8.4.1 Views: Account Removal . . . . . . . . . . . . . . . . . . . . . . 357
8.4.2 Controller: Account Removal . . . . . . . . . . . . . . . . . . . 357
8.5 Account Number in Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
8.5.1 Handler Modifications for the Path . . . . . . . . . . . . . . . 359
8.5.2 Model: Path Controller . . . . . . . . . . . . . . . . . . . . . . . . 362
8.5.3 Controller: Path Controller . . . . . . . . . . . . . . . . . . . . . 362
8.5.4 Views: Path Controller . . . . . . . . . . . . . . . . . . . . . . . . 364
8.6 Cookie . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
8.6.1 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
8.6.2 Cookie Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
8.7 Application: Cookie Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
8.7.1 View: Cookie Test . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
8.7.2 Showing Cookies . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
8.7.3 Setting Cookies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
8.7.4 Deleting Cookies . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
8.7.5 Finding Cookies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
8.7.6 Path Specific Cookies . . . . . . . . . . . . . . . . . . . . . . . . . 372
8.8 Application: Account Cookie . . . . . . . . . . . . . . . . . . . . . . . . . . 373
8.8.1 Views: Account Cookie . . . . . . . . . . . . . . . . . . . . . . . 373
8.8.2 Controller: Account Cookie . . . . . . . . . . . . . . . . . . . . 374
8.9 Shopping Cart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
8.9.1 Cart Item . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
8.9.2 Create Cart Item Database . . . . . . . . . . . . . . . . . . . . . 384
8.9.3 Model: Shopping Cart . . . . . . . . . . . . . . . . . . . . . . . . 386
Contents xv

8.10 Application: Shopping Cart . . . . . . . . . . . . . . . . . . . . . . . . . . . 390


8.10.1 Design Choices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390
8.10.2 Controller: Browse . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
8.10.3 Controller: Shopping Cart . . . . . . . . . . . . . . . . . . . . . . 393
8.10.4 Views: Shopping Cart . . . . . . . . . . . . . . . . . . . . . . . . . 395
8.10.5 Shopping Cart: Enhancement . . . . . . . . . . . . . . . . . . . 400
8.11 Persistent Shopping Cart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
8.12 Application: Persistent Shopping Cart . . . . . . . . . . . . . . . . . . . 402
8.12.1 Model: Persistent Shopping Cart . . . . . . . . . . . . . . . . . 402
8.12.2 Views: Persistent Shopping Cart . . . . . . . . . . . . . . . . . 403
8.12.3 Repository: Persistent Shopping Cart . . . . . . . . . . . . . . 405
8.12.4 Controller: Persistent Shopping Cart . . . . . . . . . . . . . . 405
8.13 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
8.14 Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
9 Web Services and Legacy Databases . . . . . . . . . . . . . . . . . . . . . . . . 411
9.1 Application: Google Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412
9.1.1 Model: Google Maps . . . . . . . . . . . . . . . . . . . . . . . . . 412
9.1.2 Handler: Process Google Maps . . . . . . . . . . . . . . . . . . 413
9.1.3 Views: Google Maps . . . . . . . . . . . . . . . . . . . . . . . . . 413
9.1.4 API Key . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414
9.2 FedEx: Rate Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
9.2.1 Expanding the WSDL File . . . . . . . . . . . . . . . . . . . . . 416
9.2.2 FedEx: Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
9.2.3 Application: FedEx . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
9.2.4 Model: FedEx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
9.2.5 Views: FedEx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
9.2.6 Controller: FedEx . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
9.3 PayPal Web Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
9.3.1 Credentials: PayPal . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
9.3.2 Application: PayPal . . . . . . . . . . . . . . . . . . . . . . . . . . 431
9.3.3 Controller: PayPal . . . . . . . . . . . . . . . . . . . . . . . . . . . 432
9.3.4 Views: PayPal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
9.3.5 Application: PayPal with Oauth . . . . . . . . . . . . . . . . . 434
9.4 Legacy Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
9.4.1 Eclipse Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
9.4.2 Install the Database Driver . . . . . . . . . . . . . . . . . . . . . 443
9.4.3 Hibernate Console . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
9.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
9.6 Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
10 Appendix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
10.1 Spring: Object Provider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
10.2 Classpath and Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453
xvi Contents

10.2.1 Usual Suspects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453


10.2.2 What is a Package? . . . . . . . . . . . . . . . . . . . . . . . . . . 454
10.3 MySQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454
10.3.1 Configuring MySQL . . . . . . . . . . . . . . . . . . . . . . . . . . 454
10.3.2 MySql Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
10.4 Old School . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456
10.4.1 Validation the Hard Way . . . . . . . . . . . . . . . . . . . . . . 456
10.4.2 Initialising Complex Elements . . . . . . . . . . . . . . . . . . . 463
10.4.3 Application: Old SchoolInitialised Complex
Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
10.5 Source Code of Complicated Controllers . . . . . . . . . . . . . . . . . 480
10.5.1 Servlet for a JSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
10.5.2 Controller Servlet . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483
10.5.3 Restructured Controller . . . . . . . . . . . . . . . . . . . . . . . . 484
10.5.4 Spring Restructured Controller . . . . . . . . . . . . . . . . . . 485
10.5.5 Enhanced Controller . . . . . . . . . . . . . . . . . . . . . . . . . . 486
10.5.6 Persistent Controller . . . . . . . . . . . . . . . . . . . . . . . . . . 488
10.5.7 Complex Persistent Controller . . . . . . . . . . . . . . . . . . . 490
10.5.8 Account Path and Shopping Cart . . . . . . . . . . . . . . . . . 493

Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
Web Applications and Maven
1

This chapter explains how information is sent between a browser and a server. It
begins with descriptions of the request from a browser and a response from a server.
Each has a format that is determined by the Hypertext Transfer Protocol [HTTP].
Basic HTML tags are introduced next, followed by HTML forms for collecting
data. Data is easily passed from one page to another, but the data cannot be
processed without a dynamic engine like a servlet engine. Maven is introduced as a
development environment that easily incorporates a servlet engine into an appli-
cation. Using Maven, a web server can be started that hosts a web application that
can be compiled and run. The chapter explains markup languages, with a detailed
description of the Hypertext Markup Language [HTML], which sends formatted
content from the server to the browser. An important feature of HTML is its ability
to easily request additional information from the server through the use of hypertext
links. HTML forms are covered. These send data from the browser back to the
server. Information from the form must be formatted so that it can be sent over the
web. The browser and server handle encoding and decoding the data.
Simple web pages cannot process form data that is sent to them. One way to
process form data is to use a web application and a Java Server Page [JSP]. In a
JSP, the Expression Language [EL] simplifies access to the form data and can be
used to initialise the form elements with the form data that is sent to the page.
JSPs are processed by a program known as a servlet engine. The servlet engine
receives the request and response data from the web server and processes the
request from the browser. The servlet engine translates all JSPs into programs
known as servlets.
Servlets and JSPs must be run from a servlet engine. Maven has the ability to
embed a Tomcat servlet engine into the application.

© Springer Nature Switzerland AG 2021 1


T. Downey, Guide to Web Development with Java, Texts in Computer Science,
https://doi.org/10.1007/978-3-030-62274-9_1
2 1 Web Applications and Maven

1.1 Hypertext Transfer Protocol

Whenever someone accesses a web page on the Internet, two computers commu-
nicate. One computer has a software program known as a browser, the other
computer has a software program known as a web server. The browser sends a
request to the server and the server sends a response to the browser. The request
contains the name of the page that is being requested and information about the
browser that is making the request. The response contains the page that was
requested (if it is available), information about the page, and information about the
server. Figure 1.1 depicts the aspects of the request and response.
When the browser makes the request, it mentions the protocol that it is using:
HTTP/1.1. When the server sends the response, it also identifies the protocol it is
using: HTTP/1.1. A protocol is not a language; it is a set of rules that must be
followed. For instance, one rule in HTTP is that the first line of a request will
contain the type of request, the address of the page on the server and the version of
the protocol that the browser is using. Another rule is that the first line of the
response will contain the version of the protocol that the server is using, a numeric
code indicating the success of the request and a sentence describing the code.
Protocols are used in many places, not just with computers. When the leaders of
two countries meet, they must decide on a common protocol in order to commu-
nicate. Do they bow or shake hands when they meet? Do they eat with chopsticks or
silverware? It is the same situation for computers, in order for the browser and
server to communicate, they must decide on a common protocol.

Fig. 1.1 The request and response have specific formats, as specified by HTTP
1.1 Hypertext Transfer Protocol 3

1.1.1 Request Format

The request from the browser has the following format in HTTP:

a. The first line contains the type of request, the name of the requested page and
the protocol that is being used.
b. Subsequent lines are the request headers. They contain information about the
browser and the request.
c. A blank line in the request indicates the end of the request headers
d. In a POST request, additional information can be included after the blank line.

Typical information that is contained in the request headers is the brand of the
browser that is making the request, the types of content that the browser prefers, the
languages and character set that the browser prefers and the type of connection that
is being used. The names of these request headers are User-agent, Accept,
Accept-language and Accept-charset, respectively (Table 1.1).

1.1.2 Response Format

The response from the server has the following format in HTTP:

a. The first line contains the protocol being used, the status code and a brief
description of the status.
b. Subsequent lines are the response headers. They contain information about the
server and the response.
c. A blank line in the response indicates the end of the response headers.
d. In a successful response, the content of the page will be sent after the blank line.

Typical information that is contained in the response headers is the brand of the
server that is making the response, the type of the file that is being returned and the
number of characters that are in the file. The names of these response headers are
Server, Content-Type and Content-length, respectively (Table 1.2).

Table 1.1 Common request headers


User-agent Identifies the type of browser that made the request
Accept Specifies the MIME types that the browser prefers
Accept-language Indicates the user’s preferred language, if multiple versions of the
document exist
Accept-charset Indicates the user’s preferred character set. Different character sets can
display characters from different languages
4 1 Web Applications and Maven

Table 1.2 Common response headers


Server Identifies the type of server that made the response
Content-type Identifies the MIME type of the response
Content-length Contains the number of characters that are in the response

1.1.3 Content Type

The server must also identify the type of information that is being sent. This is
known as the Content Type. Different content types define text, graphics, spread-
sheets, word processors and more.
These content types are expressed as Multipurpose Internet Mail Exten-
sions [MIME] types. MIME types are used by web servers to declare the type of
content that is being sent. MIME types are used by the browser to decode the type
of content that is being received. If additional data is included with the request, the
browser uses special MIME types and additional request headers to inform the
server. The server and browser will each contain a file that has a table of MIME
types with the associated file extension for that type.
The basic structure of a MIME type is a general type, a slash and a specific type.
For example, the general type for text has several specific types, for plain text,
HTML text and style sheet text. These types are represented as text/plain, text/html
and text/css, respectively. When the server sends a file to the browser, it will also
include the MIME type for the file in the header that is sent to the browser.
MIME types are universal. All systems have agreed to use MIME types to
identify the content of a file transmitted over the web. File extensions are too
limiting for this purpose. Many different word processor programs might use the
extension .doc to identify a file. For instance, .doc might refer to an MS WORD
document or to an MS WORDPAD document. It is impossible to tell from the
extension which program actually created the program. In addition, other programs
could use the .doc extension to identify a program: for instance, WordPerfect could
also use the .doc extension. Using the extension to identify the content of the file
would be too confusing.
The most common content type on the web is HTML text, represented as the
MIME type text/html.

1.2 Markup Language

I am confident that most students have seen a markup language. I remember my


days in English composition classes: my returned papers would always have cryptic
squiggles written all over them (Fig. 1.2).
1.2 Markup Language 5

Fig. 1.2 Editors use markup to annotate text

Some of these would mean that a word was omitted (^), that two letters were
transposed (a sideways '' S ',' enclosing the transposed letters), or that a new para-
graph was needed (a backwards, double-stemmed '' P '). ' These marks were invalu-
able to the teacher who had to correct the paper because they conveyed a lot of
meaning in just a few pen strokes. Imagine if a program could accept such a paper
that is covered with markup, read the markup and generate a new version with all
the corrections made.
There are other forms of markup languages. The script of a play has a markup
language that describes the action that is proceeding while the dialog takes place.
For instance, the following is a hypothetical script for the 3 Stooges:

Moe: Oh, a wise guy, huh? <Pulls Larry’s hair>


Larry: It wasn’t me. <Hits Curly in the stomach>
Moe: What are you doing? <Tries to poke Curly in the eye>
Curly: Nyuk, nyuk, nyuk. <Places hand in front of eyes>
Moe: Ignoramus. <Bonks Curly on top of the head>

Every markup language has two parts.

a. The plain text


b. The markup, which contains additional information about the plain text.

1.2.1 Hypertext Markup Language

HTML is the markup language for the web. It is what allows the browser to display
colours, fonts, links and graphics. All markup is enclosed within the angle brack-
ets <and>. Directly adjacent to the opening bracket is the name of the tag. Addi-
tional attributes can be included after the name of the tag and before the closing
bracket.
HTML tags are intermixed with plain text. The plain textis what the viewer of a
web page will see. The HTML tags are commands to the browser for displaying the
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
6 1 Web Applications and Maven

text. In this example, the plain text ‘This text is strong’ is enclosed within the
HTML tags for making text look strong:

<strong> This text is strong</strong>

The viewer of the web page would not see the tags, but would see the text
rendered strongly. For most browsers, strong text is bold, and the sentence would
appear as:
This text is strong
HTML has two types of tags: singletons and paired tags.
Singletons have a limited amount of text embedded within them as attributes or
they have no text at all. Singletons only have one tag. Table 1.3 gives two examples
of singleton tags.
Paired tags are designed to contain many words and other tags. These tags have an
opening and a closing tag. The text that they control is placed between the opening and
closing tags. The closing tag is the same as the opening tag, except the tag name is
preceded by a forward slash /. Table 1.4 gives four examples of paired tags.

Table 1.3 Examples of singletons


Tag Explanation
<br> Insert a line break into the document
<input> Insert a form element into the document. This is a tag that has additional
attributes, which will be explained below

Table 1.4 Examples of paired tags


Tag Explanation
<strong> strong </strong> Typically, the enclosed text is rendered in a thicker
font
<ins> inserted </ins> Typically, the enclosed text is rendered with an
underline
<em> emphasised </em> Typically, the enclosed text is rendered in an italic font
<p> paragraph </p> The enclosed text will have at least one empty line
preceding it

Table 1.5 Two essential form element types


Type Example
text <input type=''text'' name=''hobby'' value=''''>
The value attribute is the text that appears within the element when the page is
loaded
submit <input type=''submit'' name=''nextButton'' value=''Next''>
The value attribute is the text that appears on the button in the browser
1.2 Markup Language 7

1.2.2 Basic Tags for a Web Page

We are very sophisticated listeners. We can understand many different accents. We


can understand when words are slurred together. However, if we were to write out
the phonetic transcription of our statements, they would be unreadable. There is a
correct way to write our language, but a sophisticated listener can detect and correct
many errors in pronunciation.
For instance, most English speakers would understand me if I asked the question
Jeet yet?
In print, it is incomprehensible. A proper response might be
No, joo?
Or,
Yeah, I ate.
As we become more proficient in a language, we are able to understand it, even
when people do not enunciate clearly.
In the same way, all markup languages have a format that must be followed in
order to be correct. Some language interpreters are more sophisticated than others
and can detect and correct mistakes in the written format. For example, a paragraph
tag in HTML is a paired tag and most browsers will render paragraphs correctly,
even if the closing paragraph tag is missing. The reason is that paragraph tags
cannot be nested one inside the other, so when a browser encounters a new <p> tag
before seeing the closing </p> for the current paragraph, the browser inserts a
closing </p> and then begins the new paragraph. However, if an XML interpreter
read the same HTML file with the missing </p> tag, the interpreter would report
an error instead of continuing to parse the file. It is better to code all the tags that are
defined for a well-formed HTML document, than to rely on browsers to fill in the
missing details.
Standard Tags
The HTML specification defines a group of standard tags that control the structure
of the HTML document. These three tags contain all the information for the page.

<html> html code </html>

The html tags enclose all the other tags and text in the document. It only contains
the following two sections.

<head> browser command tags </head>

The head tags enclose tags that inform the browser about how to display the
entire page. These control how the page appears in the browser, but do not
8 1 Web Applications and Maven

contain any content for the page. This paired tag belongs within the paired html
tags.
<body> body tags </body>

The body tags contain all the plain text and HTML tags that are to be displayed
in the browser window. This paired tag belongs within the paired html tags.
While the body section contains the normal HTML tags discussed in this chapter,
like strong and em, the head section contains special markup tags that indicate
how the browser should display the page. The meta and title tags belong in the head
section.

<title> title text </title>

The title tags enclose the text that will display in the title bar of the browser
window.

<meta charset = ''UTF-8''>

The meta tag is a singleton that indicates extra information for the browser. This
tag can be repeated to include different information for the browser. A standard
page should include a meta tag with charset='' utf-8 '.' This indicates the character
set for the language that is being used to display the page.
HTML Validation
The WWW Consortium [W3C] publishes the HTML standard and provides tools for
HTML validation that will test that a page has the correct HTML structure. In order
to comply with the HTML specification, all web pages should have the following
structure.

<!DOCTYPE HTML>
<html>
<head>
<meta charset=''utf-8''>
<title>Simple Page</title>
</head>
<body>
<p>
This is a <em>simple</em> web page.
</body>
</html>

a. The DOCTYPE defines the type of markup that is being used. It precedes the
html tag because it defines which version of HTML is being used.
1.2 Markup Language 9

b. All the tags and plaintext for the page are contained within the paired html
tags.

i. Place a head section within the paired html tags.

A. Place a paired title tag within the head section.


B. Place a singleton meta tag for the character set within the head section.

ii. Place a body section within the paired html tags.

c. The DOCTYPE and meta tags are required if the page is to be validated by W3C
for correct HTML syntax. Go to https://www.w3.org to access the HTML
validator.

There is no excuse for a web page to contain errors. With the use of the vali-
dation tool at https://www.w3.org, all HTML pages should be validated to ensure
that they contain all the basic tags.
Layout versus Style
Two types of information are contained in each HTML page: layout and style. The
basic layout is covered in this chapter; advanced layout and style are covered in
Chap. 7. Style information contains things like the colours and font for the page.
The recommended way to handle style and layout is to place all the layout tags in
the HTML page and to place all the style information in a separate file, called a
style sheet. For the interested student, the HTML and style information from
Chap. 7 can be read at any time.
Hypertext Markup Language Five [HTML5] is the latest version of the HTML
standard. In the previous versions, tags could specify the style of a page. In the new
version, those tags have been deprecated. In order to validate that a page conforms
to version 5, the tags that specify specific style cannot be used.
In previous versions of the HTML standard, different DOCTYPE statements
could be used for HTML pages: strict and transitional. The strict one was the
recommended one, since it enforced the rule that all style information be contained
in a separate file. Version five has no choices for the DOCTYPE: all pages must use
strict HTML. All pages for this book will use the new DOCTYPE for HTML5.

<!DOCTYPE HTML>

Word Wrap and White Space


Most of us type text in a word processor and let the program determine where the
line breaks belong. This is known as word wrap. The only time that we are required
to hit the enter key is when we want to start a new paragraph.
Browsers will use word wrap to display text, even if the enter key is pressed.
Browsers will treat a new line character, a tab character and multiple spaces as a
10 1 Web Applications and Maven

single space. In order to insert a new line, tab or multiple spaces in an HTML page,
markup must be used: if it is not plain text, then it must be placed in markup.
Browsers take word wrap one step further. Browsers will compress all con-
secutive white space characters into a single space character. The common white
space characters are the space, the tab and the new line character. If five spaces start
a line, they will be compressed into one space.
The following listing contains a web page that has a poem.

<!DOCTYPE HTML>
<html>
<head>
<meta charset=''utf-8''>
<title>A Poem</title>
</head>
<body>
Roses are red
Violets are blue
This could be a poem
But not a haiku
A haiku has a fixed structure. The first line has five
syllables, the second line has seven syllables and the
third line has five syllables. Therefore, the previous
poem cannot be a haiku.
</body>
</html>

Even though the poem has four lines, the poem will appear as one line in the
browser. This is because no markup was added to indicate that one line has ended
and another line should begin. The browser will wrap to a new line if the poem
would extend beyond the right margin of the browser.

Try It
https://bytesizebook.com/guide-boot/ch1/poem.html

Fig. 1.3 How the poem will appear in the browser


Random documents with unrelated
content Scribd suggests to you:
Days in Hospital No. of cases
0–1 (admission) 15 (2 not acute)
2–7 10
More than 7 12
2. Classification according to stage of the disease:
During acute stage 21 cases
After acute stage 16 cases
The first classification shows only 13 cases positive when cultured on admission to the hospital and
also during the acute stage of the disease; the incidence of S. hemolyticus in patients on admission is
very low (1.76 per cent).
The second classification shows a slightly higher incidence for cases during the acute stage of the
disease, regardless of whether they were admitted to the measles service from camp or from another
service of the hospital (2.4 per cent). These findings conform with those at Fort Riley in a smaller series
of cases and support the opinion that the hemolytic streptococci temporarily disappear from the throat
during the acute onset of measles. Unfortunately controls among normal men in Camp Pike were not
taken at intervals throughout the period of three months represented by this study of measles, but all
controls taken show a higher incidence than that found among measles patients on admissions over a
period of time comparable to that of the control series.
The gradual increase in the percentage of patients developing hemolytic streptococci in their throats
in wards receiving only streptococcus free cases demonstrates that the admission culture and the
subsequent weekly cultures, with the separation of all patients identified as carriers, did not suffice to
control the spread of streptococcus in this group of cases. It is interesting to note that the greatest
incidence of streptococcus carriers among these patients occurred three weeks after the height of the
measles epidemic, when it became about four times that observed at the height of the measles
epidemic.
When we consider the time relations of the streptococcus complications, it is noteworthy that they
begin to appear somewhat after the appearance of streptococcus carriers and then increase parallel
with the increase in the numbers of carriers. The relative number of complications developing among
the first carriers which were identified is less than that among the carriers appearing later. This suggests
an increase in virulence of hemolytic streptococci attending their wider dissemination.
Tables LXII and LXIII are introduced for the purpose of showing to what extent duration of stay in the
hospital increases the individual’s chances of acquiring hemolytic streptococci. Table LXII includes all
cases admitted to and treated in the measles wards. On repeated cultures, previous positives and
negatives were cultured alike and the total positives reported for each week.
Table LXIII includes only those cases treated in the “clean” wards and known to be negative on
previous culture.
Table LXII

Incidence of Hemolytic Streptococci in Throats of Measles Cases with Reference to Period in Hospital

(All cases treated in the wards)

PERIOD IN MEASLES NO. CASES CULTURED NO. POSITIVE FOR PER CENT POSITIVE FOR
WARD HEMOLYTIC HEMOLYTIC
STREPTOCOCCI STREPTOCOCCI
(Admission) 867 37 4.2
1 week 768 84 10.9
2 weeks 479 109 22.8
3 weeks 240 63 26.2
4 weeks 133 44 33.1
5 weeks 82 26 31.7
6 weeks 53 14 26.4
7 weeks 25 8 32.0
8 weeks 13 1 7.7
9 weeks 9 1 11.1
10 weeks 6 0 0
11 weeks 5 0 0

Table LXIII

Weekly Development of Hemolytic Streptococci in Throats of Patients Treated in “Clean” Wards

PERIOD IN MEASLES NO. CASES CULTURED NO. POSITIVE FOR PER CENT POSITIVE FOR
WARD HEMOLYTIC HEMOLYTIC
STREPTOCOCCI STREPTOCOCCI
1 week 738 67 9.1
2 weeks 424 74 17.4
3 weeks 195 34 17.4
4 weeks 92 16 17.4
5 weeks 46 7 15.2
6 weeks 26 4 15.4
7 weeks 14 3 21.4
8 weeks 8 0
9 weeks 5 0
10 weeks 4 0
11 weeks 3 0
A comparison of Tables LXII and LXIII gives some indication of what might have been expected if the
carriers had not been removed from the treatment wards at weekly intervals. With the carriers removed
from the “clean” cases and segregated in a separate ward so as to be removed effectively as sources of
spread of the S. hemolyticus infection to clean cases, the percentage incidence with all cases considered
rose to a point nearly twice as high as that ever reached in the wards where clean cases alone were
allowed to remain. Had these carriers not been separated, and remained in contact with cases free from
hemolytic streptococci, they would have served as just so many more sources of infection, and an
incidence of at least twice that recorded for all cases combined, or four times that of the treatment
wards, might have been expected. These results indicate that the weekly separation of carriers from
clean cases did, to a considerable extent, lower the individual’s danger of acquiring S. hemolyticus
infection while in the hospital.
Complications of Measles
In Table LXIV the complications developing in the measles patients under observation at Camp Pike
are tabulated. In the division of the complications developing in “carriers” and “noncarriers” of the
hemolytic streptococci, reference is made only to the records of the throat cultures. The division is
therefore not dependent upon the bacteriology of the complications. For example, only 9 of the 12
cases of pneumonia developing in “carriers” were streptococcus pneumonias. On the other hand, the
cases of mastoiditis following otitis media were almost invariably due to hemolytic streptococci. Of the
10 otitis cases occurring in “noncarriers,” 4 developed mastoiditis and 3 of these showed hemolytic
streptococci on culture from the mastoid cells at operation. Missed cases of identification of S.
hemolyticus by throat culture in cases which develop S. hemolyticus complications may arise from a
number of causes. It is desired here only to direct attention to these discrepancies.
Pneumonia Following Measles.—Fifty-six cases of pneumonia following measles occurred during
the period of observation in this group of 867 cases of measles. Of these, 9 were streptococcus
pneumonias. This gives an incidence for streptococcus pneumonias of 1.04 per cent, while that for all
the pneumonia is 6.4 per cent. There were 8 cases of lobar and 48 cases of bronchopneumonia.
Seventeen fatal cases occurred giving a mortality rate of 30.4 per cent for the group. Five of these fatal
cases occurred among the 9 streptococcus pneumonias. The mortality rate for the streptococcus
pneumonia thus was 55.5 per cent; that for the nonstreptococcus group was 25.5 per cent. All 9 cases
of streptococcus pneumonia developed empyema. In 7 cases it was diagnosed clinically; in 2 at autopsy
only. No cases of empyema developed in the group of nonstreptococcus pneumonias.
Table LXIV

Complications Developing in 867 Cases of Measles at Camp Pike. Distribution of Complications Between 242 “Carriers” and 625 “Noncarriers” of Hemolytic
Streptococci from September 15 to December 15, 1918

NAME OF NUMBER OCCURRING IN PER CENT IN


COMPLICATION CASES WITH
INCOMPLETE
RECORD OF
“CARRIERS” OF “NONCARRIERS” THROAT TOTAL ALL HEM. STREP. “NONCARRIERS”
HEM. STREP. OF HEM. STREP. CULTURES NUMBER CASES “CARRIERS” OF HEM. STREP.
Pneumonia 12 44 0 56 6.4 5.0 7.0
Otitis media 31 11 6 48 5.5 12.8 1.8
Mastoiditis (following otitis
media) 15 4 4 23 2.6 6.2 0.6
Local meningitis (extension
from mastoid) 2 0 0 2
Frontal sinusitis 1 0 0 1
Ethmoidal sinusitis 0 1 0 1
Suppurative arthritis 1 0 0 1
Cervical adenitis 1 0 0 1
Acute bronchitis 4 2 0 6
Acute tonsillitis 4 1 0 5
Acute laryngitis and aphonia 1 0 0 1
Acute pleurisy 2 1 0 3
Erysipelas of face 0 1 0 1
Epidemic meningitis 0 1 0 1

Note.—The percentages of incidence of pneumonia and otitis media in the “carrier” and “noncarrier” groups are at direct variance. It would appear from these findings
that streptococci very readily invade the middle ear from the throat and set up grave disorders. The invasion of the lung from the throat occurs with less frequency.
Hemolytic streptococci perhaps never initiate the pneumonic processes and can be regarded as more or less accidental secondary invaders.

The relation of these pneumonias following measles, to the influenza epidemic has been discussed.
The time relations between the onsets of measles and that of the subsequent pneumonia vary widely.
There appears to be nothing constant in the length of time between the onset of measles and that of
the pneumonia. In 30 of the cases this period is less than ten days; in the remaining 26 cases, it ranges
from ten to thirty-two days (Chart 4).
In the ward treatment of these cases of pneumonia, they were divided into three groups according to
their clinical characters and according to the results of throat and sputum cultures.
( a) Streptococcus pneumonias 9 cases
(b) Pneumonia with hemolytic streptococci in the throat without symptoms referable to the streptococcus 13 cases
( c) Pneumococcus pneumonias not carrying hemolytic streptococci 34 cases
The streptococcus-free cases were treated in a separate ward. Cases were admitted to this ward
directly from the “clean” measles wards, but only after a throat culture taken prior to their transfer had
been negative for the hemolytic streptococcus.
The other two groups were treated together in another ward, but in strictly separate compartments of
it. This precaution was carried out on the assumption that patients with an acute streptococcus
pneumonia were real sources of danger in the ward because of a heightened virulence of the organism
causing the grave symptoms. The pneumonias subsequently developing hemolytic streptococci in their
throats, without their presence modifying the course of the pneumonia, came to be regarded as being
in the same class with uncomplicated cases of measles carrying hemolytic streptococci, in so far as their
being potential sources of danger in a ward is concerned.

Chart 4.—Shows the time interval


between the onset of measles and
the onset of the subsequent
pneumonia in the 56 cases of
pneumonia following measles at
Camp Pike. Each case is represented
by one of the small blocks measured
along the ordinate. The onset of
measles in all cases is represented by
the line at the extreme left of the
chart. The onset of pneumonia in
each case is indicated by the limit of
the block marked off in days to the
right of this line.

(a) Streptococcus Pneumonias.—Nine cases of streptococcus pneumonia developed. Of the 867


cases of measles studied, 242 showed throat cultures positive for the hemolytic streptococci at some
period of their stay in the hospital. It appears then that 3.7 per cent of the patients carrying hemolytic
streptococci in their throats developed streptococcus pneumonia. Thirty-seven cases had positive throat
cultures when first observed on admission to the measles wards. It is significant to note that not a
single case of pneumonia of any kind developed among these cases.
MEASLES PNEUMONIA; STREPTOCOCCUS GROUP
Case 98, O. McN. Onset of measles, Sep. 19; admitted to hospital Sep. 21; onset of bronchopneumonia, Oct. 21; of
empyema, Oct. 23. Recovered from pneumonia; convalescent in empyema ward.
Bacteriology.—1. Throat culture for: (a) S. hem.: Sep. 21, −; 28, −; Oct. 9, −; 20, −; 23, +; Nov. 2, −; 9, −; 15, −; (b) B.
influenzæ: Sep. 21, +; 28, −; Oct. 9, +. 2. Pleural fluid (culture) S. hem. Oct. 23, +.
Case 141, J. G. G. Autopsy No. 438. Onset of measles, Sep. 28; admitted to hospital, Oct. 1; onset of bronchopneumonia,
Oct. 6; of otitis media (bilateral), Oct. 12; died, Oct. 18.
Bacteriology.—1. Throat culture for: (a) S. hem., Oct. 2, −; 6, −; 8, −; (b) B. influenzæ, Oct. 2, −; 6, +; 8, +. 2. Autopsy
cultures: Heart blood, negative; left lung, Pneumococcus II atypical, B. influenzæ and S. viridans; right lung, S. hem. and B.
influenzæ; right bronchus, S. hem. and B. influenzæ.
Case 147, S. W. Autopsy No. 442. Onset of measles, Oct. 1; admitted to hospital, Oct. 2; onset of bronchopneumonia, Oct.
17, with chill and rapid development; died, Oct. 18.
Bacteriology.—1. Throat culture for: (a) S. hem., Oct 2, −; 9 −; 15, −; 18, +; (b) B. influenzæ, Oct. 2, −; 9, −; 15, −; 18,
−. 2. Autopsy cultures: Heart blood, S. hem.; right main bronchus, S. hem. and B. influenzæ.
Case 281, T. M. Onset of measles, Oct. 6; admitted to hospital Oct. 9; onset of bronchopneumonia, Oct. 21; of empyema,
Oct. 23; recovered from pneumonia; convalescent in empyema ward.
Bacteriology.—1. Throat culture for: (a) S. hem., Oct. 10, −; 20, −; 24, +; Nov. 2, +; 9, +; 15, +; (b) B. influenzæ, Oct.
10, −; 20, +. 2. Culture from pleural fluid, Oct. 23, S. hem.
Case 285, J. H. Onset of measles, Oct. 4; admitted to hospital, Oct 9; onset of lobar pneumonia, Oct. 29; of empyema,
Nov. 9; convalescent in empyema ward.
Bacteriology.—1. Throat cultures for: (a) S. hem., Oct. 11, −; 20, −; 24, +; 29, −; Nov. 2, −; 9, −; (b) B. influenzæ, Oct.
11, −. 2. Cultures from pleural fluid, Nov. 9 and 13, S. hem.
Case 714, W. H. Onset of measles, Oct. 26; admitted to hospital, Oct. 28; otitis media, Nov. 8; onset of
bronchopneumonia, Nov. 9; of empyema, Nov. 17; convalescent in pneumonia ward.
Bacteriology.—1. Throat cultures for: S. hem., Oct. 28, −; Nov. 4, −; 12, +; 23, +; 30, +; Dec. 7, +; 12, −. 2. Sputum:
Nov. 10, Pneumococcus II atypical, S. hem. and B. influenzæ.
Case 730, W. S. Autopsy No. 491. Onset of measles, Oct. 26; admitted to hospital, Oct. 29; onset of bronchopneumonia,
Nov. 10; of empyema, Nov. 11; of cervical adenitis, Nov. 5; died, Nov. 15.
Bacteriology.—1. Throat culture for: S. hem., Oct. 30, −; Nov. 4, +. 2. Sputum: Nov. 10, S. hem. 3. Pleural fluid: Nov. 11,
S. hem. Autopsy bacteriology: Heart blood, S. hem.; right main bronchus, B. influenzæ, B. coli; right lung, S. hem. and B.
influenzæ; right pleura, S. hem.; peritoneum, S. hem.
Case 751, P. B. Autopsy No. 492. Entered hospital, Oct. 19; onset of measles, Oct. 30; of bronchopneumonia, Nov. 5; of
right empyema, Nov. 12; died, Nov. 16.
Bacteriology.—1. Throat cultures for: S. hem., Nov. 1, −; 4, +; 15, +. 2. Sputum: Nov. 13, B. influenzæ and S. hem. 3.
Autopsy cultures: Heart blood, S. hem.; right lung, S. hem., Pneumococcus IV, B. influenzæ, B. coli; pericardium, negative;
right pleura, S. hem.; peritoneum, S. hem.
Case 880, B. McN. Autopsy No. 507. Onset of measles, Nov. 30; entered hospital, Dec. 3; onset of bronchopneumonia,
Dec. 11; of empyema, Dec. 14; died, Dec. 14.
Bacteriology.—1. Throat cultures for: S. hem., Dec. 3, −; 5, −; 12, +. 2. Cultures from pleural fluid, Dec. 14, S. hem. 3.
Autopsy cultures: Heart blood, S. hem.; right main bronchus, S. hem., B. influenzæ, staphylococcus (a few); left lung, S.
hem.; left pleura, S. hem.
The average period in the hospital before the development of the streptococcus pneumonia is about
two weeks. Cases 98 and 285 were in the hospital thirty and twenty days respectively before the onset
of pneumonia. There is a record of from one to four negative throat cultures on each case before
streptococcus was found in the throat. This enables us to fix the onset of the pneumonia with reference
to the appearance of the streptococcus in the throat.
Case 141 stands alone as representing a class in which S. hemolyticus was implanted upon a
pneumococcus pneumonia during its course. In this instance two throat cultures on alternate days after
the onset of the pneumonia were negative for hemolytic streptococci. Unfortunately the last record of a
throat culture is for one taken ten days before the fatal termination of the case, and it can only be
stated that the S. hemolyticus infection was implanted within the last ten days of the course of the
pneumonia, perhaps on or about October 12 when bilateral otitis media developed.
In Cases 285 and 730 hemolytic streptococci were found in the throats five and six days respectively
before the onset of pneumonia. They represent the 2 cases of pneumonia which developed in patients
isolated in the streptococcus “carrier” ward. Case 285 is of particular interest for several reasons. It is
the only case of lobar pneumonia in the group and happens also to be the only case from which B.
influenzæ was not obtained. S. hemolyticus was found only once on throat culture, i.e., five days before
the onset of the pneumonia. Three throat cultures after the onset of the pneumonia were negative. The
case ran the course of a lobar pneumonia. Eleven days after the onset (November 9) a small amount of
pleural fluid was diagnosed. Aspirated fluid on this date and again four days later showed many
streptococci in smears and pure cultures of S. hemolyticus.
The remaining 6 cases belong to a group in which hemolytic streptococci were first identified in the
throats after the cases had been reported to the laboratory as pneumonia suspects to be examined by
culture before transfer from the measles ward. In all these cases the culture taken at this time was
positive while all cultures taken before were negative. In some cases, e. g., Cases 98, 147, and 281,
throat cultures taken only one or two days before the onset of the pneumonia were negative. In these
cases the onset of the pneumonia and the appearance of the streptococcus in the throats appear to be
simultaneous.
It should be noted that the period between the appearance of the hemolytic streptococci in the throat
and the development of the pneumonia is very short in all cases. In this small group of cases S.
hemolyticus infection which has complicated pneumonia has been acquired at or near the time of onset
of the pneumonia.
(b) Pneumonia with Hemolytic Streptococci in the Throat without Symptoms Referable to
the Streptococcus.—Thirteen cases of pneumonia associated with measles developed into S.
hemolyticus “carriers” without having the course of the disease affected by the presence of the
organism in the throat. Cases 705, 872, and 188 are of interest in that hemolytic streptococci were
identified in the throats from one to six days prior to the onset of the pneumonia. In spite of their
presence, the symptoms, course and outcome of the pneumonia were apparently unaffected. One of
these cases (Case 872) died. Autopsy showed lobar pneumonia with no signs of invasion of the lung by
hemolytic streptococci. Cultures at autopsy showed that pneumonia was due to a pneumococcus, Type
II atypical. A few hemolytic streptococci were found in culture from the right main bronchus.
Of the remaining 10 cases 1 developed S. hemolyticus in a throat culture at the end of the first week
of the pneumonia; 3 during the second week; 1 during the third week, and 5 further along in the
convalescent period. In 8 cases hemolytic streptococci appeared in the throat, at a time when invasion
of the lower respiratory tract by the streptococcus might be expected, and yet none of them developed
evidence of streptococcus pneumonia. The 9 cases with hemolytic streptococci appearing late in
convalescence are not of particular interest, since the dangers of lower respiratory invasion are much
reduced after the acute stage of the pneumonia has passed. Three of these cases (Cases 678, 725 and
398) did however develop ear complications directly referable to the streptococcus invasion of the
throat. Two of them terminated in mastoiditis with operation. These cases emphasize the greater
tendency of S. hemolyticus to invade the middle ear rather than the lung.
In 3 fatal cases of pneumococcus pneumonia in which during life no hemolytic streptococci were
found by throat culture, a few hemolytic streptococci were found at autopsy in culture from the main
bronchi, along with predominating growths of pneumococci and B. influenzæ. In 2 instances there was
frank lobar pneumonia and in the third bronchopneumonia; there was no evidence to show that
hemolytic streptococci had any relation to the pneumonia which was found.
MEASLES PNEUMONIAS; GROUP CARRYING HEMOLYTIC STREPTOCOCCI
Case 705. Onset of measles, Oct. 25; admitted to hospital, Oct. 27; onset of bronchopneumonia, Nov. 10; acute pleurisy,
Nov. 16; convalescent in pneumonia ward.
Bacteriology.—1. Throat cultures for: S. hem., Oct. 27, −; Nov. 4, −; 11, +; 15, +; 23, −; 30, −; Dec. 7, −; 12, −. 2.
Sputum: Nov. 10, Pneumococcus II atypical, S. hem. and B. influenzæ.
Case 872. Autopsy No. 508. Onset of measles, Nov. 29; admitted to hospital, Nov. 30; onset of lobar pneumonia, Dec. 10;
died, Dec. 14.
Bacteriology.—1. Throat cultures for: S. hem., Nov. 30, −; Dec. 5, +; 10, +; 12, +; 14, +. 2. Autopsy culture: Heart blood,
Pneumococcus II atypical; right main bronchus, Pneumococcus II atypical, B. influenzæ, S. hem. (a few); left lung,
Pneumococcus II atypical; left pleura, Pneumococcus II atypical.
Case 188. Onset of measles, Oct. 3; admitted to hospital, Oct. 4; onset of bronchopneumonia, Oct. 14; recovered and
discharged from hospital, Nov. 24.
Bacteriology.—1. Throat cultures for: (a) S. hem., Oct. 5, −; 8, +; 12, +; 19, +; 20, +; 27, −; Nov. 2, −; 9, +; 15, −; (b)
B. influenzæ, Oct. 5, −; 8, −; 12, +; 19, +.
Case 678. Onset of measles, Oct. 23; admitted to hospital, Oct. 25; onset of bronchopneumonia, Nov. 2; of otitis media,
Nov. 9; of mastoiditis, Nov. 13; mastoid operation, Nov. 20; still under treatment.
Bacteriology.—1. Throat cultures for: S. hem., Oct. 25, −; Nov. 4, −; 5, −; 12, +. 2. Sputum: Nov. 3, Pneumococcus Type
IV, and B. influenzæ. 3. Culture from mastoid bone at operation, Nov. 20, S. hem.
Case 389. Admitted to hospital, Oct. 2, with diagnosis of influenza; onset of bronchopneumonia, Oct. 7; onset of measles,
Oct. 13; phlebitis (right leg), Oct. 22; otitis media, Oct. 31; recovered.
Bacteriology.—1. Throat cultures for: (a) S. hem., Oct. 16 −; 20, −; 27, +; Nov. 2, +; 9, +; 15, −; 23, −; 30, −; Dec. 7, −;
12, −; (b) B. influenzæ, Oct. 16, −.
Case 725. Onset of measles, Oct. 18; one week in measles barracks; admitted to hospital, Oct. 27; onset of lobar
pneumonia, Oct. 23; otitis media, Nov. 7; mastoid operation, Nov. 20; still under treatment.
Bacteriology.—1. Throat cultures for: (a) S. hem., Oct. 29, −; Nov. 1, −; 5, −; 12, +; (b) B. influenzæ, Oct. 29, +. 2.
Sputum: Nov. 2, Pneumococcus II atypical. B. influenzæ. 3. Culture from mastoid at operation, Nov. 20, S. hem.
(c) Pneumococcus Pneumonias not Carrying Hemolytic Streptococci.—Thirty-four cases of
pneumonia following measles went through their entire course in the hospital with no throat culture
positive for hemolytic streptococci. In some of these cases there are records of twelve negative throat
cultures. Eleven fatal cases occurred in this group. Autopsy findings and bacteriology showed in each
instance that S. hemolyticus was not the cause of the pneumonia.
Measles During the Course of Pneumonia.—Eleven cases of pneumonia which developed
measles during the course of the pneumonia came under observation. Hemolytic streptococci appeared
in the throats of 3 of these patients during convalescence, but there was no evidence that it invaded the
lung. In one fatal case autopsy showed that there was no streptococcus pneumonia; pneumonia
followed influenza and the onset of measles occurred three days after the onset of bronchopneumonia.
Bacteriology of Pneumonia Following Measles.—When observations made during life are
combined with the results of postmortem cultures, the bacteriology of 35 of the 56 cases is available
and is as follows: Pneumococcus Type II atypical in 36 per cent, Type IV in 22.9 per cent, Type I in 2.8
per cent, Type III in 2.8 per cent, hemolytic streptococci in 22.4 per cent, and B. influenzæ in 88.6 per
cent of these cases.
Otitis Media and Mastoiditis Complicating Measles.—The occurrence of otitis media and
mastoiditis complicating measles in patients harboring hemolytic streptococci in their throats has already
been presented (Table LXIV). The bacteriology of these complications was not studied by this
commission. The records of the base hospital laboratory at Camp Pike contain reports of twenty-nine
cultures made at operation from pus in the middle ear and the mastoid bone. Hemolytic streptococci
were found in 22 of these cases. Throat cultures were in accord with these positive findings in all except
a few instances. The throat culture serves as a fairly reliable index of the bacterial nature of these
complications. By combining our records of throat cultures with the results of the cultures from the
lesions, hemolytic streptococci were obtained from 37 of the 48 cases of otitis media. In 23 cases of
mastoiditis following the otitis media, hemolytic streptococci were demonstrated in all except 2. It is
evident that the great majority of these complications were due to hemolytic streptococci.
The relation between the appearance of hemolytic streptococci in the throat and the onset of the
otitis is recorded in all except 4 of the 31 instances of otitis media occurring in patients with throat
cultures positive for hemolytic streptococci. These four patients had positive throat cultures when first
observed and represent the only patients who carried hemolytic streptococci when admitted to measles
wards and developed complications.
The first of these patients had been under treatment in an otologic ward during a month before
measles developed. Measles caused a recurrence of disease of the ear with double mastoiditis requiring
bilateral operation. Two other patients had been in the hospital ten and eleven days respectively before
they were admitted to the measles ward; on admission to the ward otitis media was present in one
patient and in the other it developed six days later. The fourth patient was admitted to the measles
wards directly from the camp, and culture from the throat on the day of admission showed the presence
of S. hemolyticus. Two weeks later at the time of onset of otitis media, culture from the throat
contained no hemolytic streptococci. Repeated cultures during the next three weeks were negative. No
complications of otitis media developed and no direct cultures from the ear are recorded.

Chart 5.—Shows the time relation between the identification


of hemolytic streptococci in the throats and the development
of otitis media in 27 cases shown to be due to hemolytic
streptococci. The onset of otitis media is represented by the
ordinate marked ○ . The number of days before or after the
onset of the otitis, within which the throat culture which
proved positive for hemolytic streptococci was taken, is
marked off along abscissæ to the left and right of ordinate ○
respectively. On the curve plotted these symbols are used: A
circle represents a throat culture positive for hemolytic
streptococci in a case of otitis media without extension to
mastoid. The plus sign represents a throat culture positive for
hemolytic streptococci in a case of otitis media with
mastoiditis and osteitis.

In this series of cases (Chart 5) the appearance of S. hemolyticus in the throat and the onset of otitis
media are very closely associated in those patients in whom further extensions of the streptococcus
infection occurred. In instances in which appearance of streptococci and of otitis media are separated
by an interval of more than seven days, no further extension occurred. In 8 cases in which this interval
is seven days or less there has been no further extension of the infection.
The Dissemination of Hemolytic Streptococci in Wards
Beginning October 24 cultures for the identification of carriers of hemolytic streptococci were made
from all patients in a ward and repeated at intervals of one week. Prior to this time individual patients
had been examined at intervals of one week, so that an entire ward was never studied on any particular
day. This system did not identify and remove all “carriers” in a ward at a given time and was abandoned
because it failed to show the conditions present. Investigation of wards as units proved much more
satisfactory.
The studies made in four of the double wards used for the care of patients with measles are
presented in Table LXV. During the time of this study hemolytic streptococci were more prevalent than
at an earlier period.
Cultures from the throats of all patients entering these wards were negative for S. hemolyticus on
admission. The table showing the incidence of “carriers” of hemolytic streptococci each week in these
wards demonstrates:
1. The separation of “carriers” and “noncarriers” by throat culture made on admission does not
prevent the increase of streptococcus “carriers” in wards.
2. Removal of all “carriers” found by cultures on admission and at weekly intervals is inadequate.
Table LXV

Ward Conditions with Reference to Hemolytic Streptococcus Infection

DATE OF NO. NO. PER CENT COMPLICATIONS


CULTURE PATIENTS POSITIVE POSITIVE ASSOCIATED WITH
REMARKS
CULTURED HEM. HEM. HEM. STREP. WITH
STREP. STREP. DATES OF ONSET
Ward 57
11–3 35 1 2.8
11–10 13 2 15.5 None
11–17 16 6 37.5
Ward 58 Wards 57 and 58 served by same
11–3 38 7 18.4 Otitis media: ward staff.
11–10 11 4 36.4 11–8 1 case Members of staff cultured on 11–5,
11–17 6 2 33.0 11–7 1 case 11–12 and 11–19. No positives
Ward 49
Otitis media:
10–25 37 7 18.9 10–25 2 cases
11–1 31 3 9.7 10–26 1 case
11–8 35 9 25.7 10–28 1 case
11–15 32 18 56.3 11–15 1 case
11–22 16 7 43.8 11–18 1 case
11–27 1 case
Ward 50 Wards 49 and 50 served by same
10–25 29 2 3.4 Otitis media: ward staff.
11–1 43 2 4.6 11–8 1 case Ward staff cultured:
11–8 32 3 9.4 11–13 1 case 11–5 1 positive
11–15 20 11 55.0 11–22 1 case 11–12 1 positive
11–22 11 0 0.0 11–26 2 positives
Ward 41
10–28 45 4 8.9 Streptococcus
pneumonia:
11–4 34 9 26.5 (11–9 1 case) Case of pneumonia developing on
11–11 12 8 66.6 11–10 1 case 11–9 was transferred to the
Ward closed—No patients. Otitis media: “clean” pneumonia ward without a
throat culture to warrant its
11–21 13 0 0.0 10–29 1 case
transfer; last culture 11–4
11–28 8 4 50.0 11–4 1 case negative; culture 11–12 in
12–5 12 4 33.3 11–5 1 case pneumonia ward positive
12–12 4 3 75.0 11–11 1 case
11–27 1 case
12–3 1 case
Ward 42
Streptococcus
Wards 41 and 42 served by same
pneumonia:
ward staff.
10–28 32 0 0 11–10 1 case
11–4 43 7 16.3 12–11 1 case
Ward closed—No patients. Otitis media: Ward staff cultured:
10–21 16 4 25.0 10–29 1 case 11–5 2 positive
11–28 12 1 12.5 12–3 1 case 11–12 2 positive
12–5 20 10 50.0 12–6 1 case 11–26 2 positive
12–12 14 7 50.0 12–2 1 positive
Ward 59 The 3 cases of streptococcus
Streptococcus pneumonia acquired S.
pneumonia: hemolyticus infection while
10–24 37 6 16.2 10–17 1 case patients in the 16 bed south
10–31 27 5 18.5 10–21 1 case section of this ward
11–7 9 3 33.3 10–29 1 case Case developing 10–29 was removed
from section a few days before
11–12 7 1 14.3 Otitis media: onset of pneumonia
11–1 1 case
Ward 60
Wards 59 and 60 served by same
Streptococcus
ward staff.
pneumonia:
10–24 22 1 4.5 10–21 1 case Ward staff cultured:
10–31 17 2 11.7 Otitis media: 11–5 0 positive
11–7 8 1 12.5 10–31 1 case 11–12 1 positive
11–12 6 1 16.6 11–19 0 positive
When the streptococcus complications are traced back to the wards in which the streptococcus
infection of the throat was acquired, it is found that with the exception of Case 141 (already cited) all
the streptococcus pneumonias arose from two double wards. Wards 41 and 42 furnished 4 cases at
times when streptococcus was rampant in them and 3 of these cases arose within a period of a few
days. Wards 59 and 60 furnished 4 cases, very closely associated. In 3 cases the streptococcus infection
was acquired in a section of Ward 59 containing 16 beds. These patients were in beds, of which the
positions are represented by numbers 2, 5, and 7, along one side of the ward. The fourth instance of
pneumonia appeared at the same time in Ward 60, which was attended by the same ward personnel,
but no other connection can be established between this case and the other three.
The otitis media appeared in patients scattered throughout those wards for measles in which the
weekly incidence of “carriers” was rising rapidly. This relation is illustrated by Wards 58, 50, and 41. The
same observation applies to streptococcus pneumonia arising in Wards 41 and 42. In Ward 41 the
weekly percentage of carriers are October 28, 8.9, November 4, 26.5 and November 11, 66.6. On
November 9 and 10 the first 2 cases of streptococcus pneumonia arising from this ward developed. At
the same time, November 10, a third case appeared in another part of this same ward unit (Ward 42)
where the spread of hemolytic streptococci had been very active. These observations suggest that
hemolytic streptococci may build up its virulence as the result of rapid dissemination to such a degree
that it is capable of causing grave complications.
The relation of complications to “carriers” in Wards 59 and 60 is different from that in the wards just
cited. Wards 59 and 60 were opened on October 9 and before October 17; when the first case of
fulminating streptococcus pneumonia occurred, only three “carriers” had been found in them. From
October 17 to 24 when the record in Table LXV begins eight “carriers” were removed. The appearance
of a case of severe streptococcus pneumonia in an unusually clean ward was followed by the rapid
development of “carriers,” and the appearance within twelve days of 3 other cases of streptococcus
pneumonia, 2 of which were in beds close to the first case. This sequence suggests focal dissemination
of a streptococcus from a case in which it had suddenly assumed high virulence.
An outbreak of infection with S. hemolyticus was recognized on November 12 in a measles-
pneumonia ward which had been opened for several weeks and had continued free from streptococcus.
In three patients hemolytic streptococci were found by throat cultures. Inquiry revealed that a nurse in
this ward, recognized as a streptococcus “carrier” the week before, had been retained on duty. Two
patients well advanced in the course of their pneumonias, had acquired S. hemolyticus demonstrated by
throat examination. Both patients developed otitis media with mastoid extension requiring operations.
Cultures from both at operation showed hemolytic streptococci.
The third patient, with acute pneumonia, had been sent into the ward on November 11 from Ward
42, which at the time was a highly infected ward; no culture of the throat was made before transfer.
This patient developed streptococcus pneumonia with empyema requiring subsequent operation.
Discussion.—At Camp Funston, where the prevalence of S. hemolyticus in the measles wards did not
rise above that among normal men in the camp at large, 112 consecutive cases of measles were treated
without a single complication due to hemolytic streptococci.
At Camp Pike, the investigation began at the onset of a small epidemic of measles at a time when
hemolytic streptococci were an almost negligible factor. The epidemic of measles was followed
throughout its course; and, with the passing of the epidemic, there was an increase in the prevalence of
hemolytic streptococci which assumed alarming importance in the production of complications.
The epidemic of measles was in part superimposed upon the epidemic of influenza, so that
deductions concerning complications strictly due to measles became impossible. It is evident that
influenza played a considerable part in producing the complications of measles at Camp Pike.
The dissemination of hemolytic streptococci through measles wards was controlled only in part by the
methods used. This partial control may have served to limit the incidence of streptococcus pneumonia,
nine instances occurring among 867 cases of measles.
In the ward treatment of measles effort should be directed to prevent the exposure of patients free
from hemolytic streptococci to S. hemolyticus “carriers.” By this means the rate of development of S.
hemolyticus “carriers” may be reduced.
Measures which should be adopted are as follows:
1. Adequate wards should be prepared in advance for the treatment of measles. The rather gradual
onset of epidemics of measles makes this provision possible.
2. The separation of S. hemolyticus “carriers” from other patients should be enforced. Observation
wards, where strict technic to prevent transfer of infection is practiced and where throat cultures are
made on admission, are essential. Those wards should be promptly evacuated to wards for the care of
S. hemolytic “carriers” on the one hand and for “noncarriers” on the other. As far as possible patients
should be admitted to a ward until it is filled and then another ward should receive consecutive cases in
the same manner. It is desirable to have all cases in each treatment ward in the same stage of the
disease. With this system of ward rotation convalescent wards are necessary, so that cases requiring a
period of hospitalization longer than the average may be segregated, thus rendering treatment wards
available for another levy of acute cases.
3. Strict ward technic elaborated to prevent transfer of bacterial infection from one patient to another
must be employed.
4. Throat culture for identification of “carriers” is laborious but essential. An accurate method for
identifying and reporting “carriers” as speedily as possible must be employed. A competent
bacteriologist is essential. A twenty-four hour interval between culture and its report is desirable. The
following scheme is recommended:
(a) A culture from the throat made on admission to the observation ward (first day in hospital).
(b) A culture made on the first day in the treatment ward (third day in hospital).
(c) A culture made one week later (tenth day in hospital).
If the ward incidence of hemolytic streptococci reaches 10 per cent, especially in a filled ward, the
cultures should be repeated on the thirteenth day in the hospital. If the incidence of “carriers” of
hemolytic streptococci increase rapidly, cultures on alternate days should be made so that “carriers”
may be removed from the ward. Wherever possible, culturing of the treatment wards as units should be
practiced.
5. Patients developing acute symptoms in any way suggestive of infection with S. hemolyticus should
be immediately isolated; culture from the throat should be made at once and final disposal of the
patient should depend upon its result.
Carriers of Hemolytic Streptococci
During the winter of 1917–18, with the establishment of the army camps, it very soon became
evident that in many of the serious and fatal complications of measles and other respiratory diseases,
hemolytic streptococci were playing a very important rôle. The epidemic prevalence of hemolytic
streptococci among hospital cases, and later among men on duty in the camps, was established by
bacteriologic studies. Prior to this time in civil life, hemolytic streptococci under epidemic conditions had
been studied in milk-borne epidemics of septic sore throat, such as are reported from Chicago in 1911–
13[92]; from Boston in 1911[93]; and from Baltimore in 1911–12[94]. Contact air-borne infection has not
been emphasized in considering the dissemination of hemolytic streptococci. Smillie[95] reports a few
cases of hemolytic streptococcus throat infections which he attributes to contact infection. Conditions
within the army camps were such as to suggest the dissemination of hemolytic streptococci by contact
air-borne infection. Some knowledge of the percentage of individuals showing positive throat cultures
became desirable at the very beginning of studies of contact dissemination of hemolytic streptococci.
Smillie found that only one of 100 normal throats harbored the Beta hemolytic streptococci of Smith
and Brown. Levy and Alexander[96] report the presence of hemolytic streptococci in 83.2 per cent of
healthy men at Camp Taylor, and hemolytic organisms (not definitely identified as streptococci) in 14.8
per cent of recruits arriving at Camp Taylor. Irons and Marine[97] found hemolytic streptococci among 70
per cent of healthy men at Camp Custer.
Among measles patients on admission to the hospital at Fort Sam Houston, Cole and MacCallum[98]
report 11.4 per cent and Cummings, Spruit and Lynch,[99] 35 per cent of throat cultures positive for
hemolytic streptococci. At Camp Taylor, Levy and Alexander report 77.1 per cent positive among 388
cases of measles on admission to the hospital.
The spread of hemolytic streptococci in measles wards was shown by Cole and MacCallum when on
admission 11.4 per cent of cases had positive throat cultures, 38.6 per cent after from three to five
days, and 56.8 per cent after from eight to sixteen days in the ward. In our study of hemolytic
streptococci with measles at Camp Funston, 2.6 per cent of the cases had positive throat cultures on
admission, 12.8 per cent after three to ten days, and 24.1 per cent after eight to twenty-three days in
the hospital. In a similar study at Camp Pike we found 1.7 per cent positive on admission; 10.9 per cent
after one week; 22.8 per cent after two weeks; 26.2 per cent after three weeks; and, 33.1 per cent
after four weeks in the hospital.
Hemolytic Streptococci in the Throats of Normal Men.—The percentage of normal individuals
harboring hemolytic streptococci in their throats was investigated in three distinct classes of men,
classified according to the degree of exposure to contact infection.
The first group includes men largely from country districts, cultured within an hour after being
assembled by their local draft board. The laboratory car “Lister” was sent to Hot Springs, Ark. to meet
the November draft of men to be sent to Camp Pike. These men were returned to their homes when the
armistice was signed, so that there was no opportunity to study them after they had lived under camp
conditions.
The second group includes men on duty in Camps Funston and Pike. These men, while largely from
country districts, had been living crowded together in the camp for a period varying from a few weeks
to several months.
The third group includes normal men resident in the base hospitals at Ft. Riley and Camp Pike. This
group includes at Camp Pike the medical personnel of the measles and measles pneumonia wards and
represents individuals most exposed to contact infection with hemolytic streptococci. On the other hand,
the group includes doctors, nurses and seasoned medical detachment men who are perhaps less
susceptible to respiratory infections than are raw recruits.
The results of studies of these groups are presented in Tables LXVI and LXVII.
Table LXVI

Hemolytic Streptococci in Throats of Normal Men Not Resident in the Base Hospital

PLACE OF STUDY NO. OF NO. PER CENT REMARKS


DATE CASES POSITIVE POSITIVE
FOR HEM. FOR HEM.
STREP. STREP.
Camp Funston, Kan., 274 60 21.9 Men on duty in camp including 201 white and 73
Aug., 1918. colored; in great part newly drafted men
Camp Pike, Ark., 337 25 7.4 Largely white men on duty in camp
Nov. 5 to Dec. 10,
1918
Hot Springs, Ark., [100]64 0 0.0 Men from country districts, assembled by the local draft
Nov. 12, 1918 board

Table LXVII

Hemolytic Streptococci in Throats of Normal Men Resident in the Base Hospital

PLACE OF STUDY NO. OF NO. PER CENT REMARKS


DATE CASES POSITIVE POSITIVE
FOR HEM. FOR HEM.
STREP. STREP.
Ft. Riley, Kan., 24 7 29.2 14 convalescent patients in a surgical ward; 10
Aug., 1918 laboratory workers
Camp Pike, Ark., 153 22 [101]7.5 Personnel of measles wards
Sept. 10 to Nov. 30,
1918.
The group of men studied at Hot Springs represents individuals among whom there was little chance
for contact dissemination of hemolytic streptococci. It is a control series of men from outlying districts
examined before their throat bacteriology has been complicated by the interchange of mouth organisms
which occurs when a group of men are crowded into close quarters. The entire absence of hemolytic
streptococci by the throat culture method is noteworthy. By multiplying the chances of identifying
hemolytic streptococci by making parallel cultures from the saliva, and from the peritoneal exudates of
mice inoculated with saliva, hemolytic streptococci were found, in small numbers, in 3 instances. The
findings in this group were only three throats lightly infected with hemolytic streptococci. They are in
direct contrast with the findings among individuals living in camps under crowded conditions and are in
accord with the findings among recruits arriving in camp as recorded by Levy and Alexander.
In the second group, men living for a time in camp, the findings at Camp Funston and at Camp Pike
show rather striking differences. The lower percentage incidence at Camp Pike is the more remarkable
since the studies were made soon after the influenza epidemic had swept the camp and made
necessary the hospitalization of about 20 to 25 per cent of the camp population.
In the third group, namely, individuals resident in the hospital, percentage rates at Camp Funston are
slightly higher than for men resident in camp. This difference disappears for the entire group at Camp
Pike if we consider a single throat culture, as we must for the sake of comparison. The majority of these
individuals at Camp Pike served in measles wards from which patients carrying hemolytic streptococci
were removed at weekly intervals. Seven and one-half per cent of the ward personnel were positives
when first cultured. An additional 7.5 per cent acquired the streptococcus while under observation.
Duration of the “Carrier” State.—Unfortunately there are very few observations with regard to the
duration of the “carrier” state which can be determined only by repeated cultures at short intervals. We
have made no observations of the duration of the “carrier” state in healthy men. Two hundred and
forty-two individuals carrying hemolytic streptococci were identified in the ward treatment of measles.
All except 37 of these cases were “noncarriers” when first observed. The remaining 205 include 166
contact “carriers” and 39 patients with acute symptoms of infection by hemolytic streptococci.
The complete record of throat cultures on these cases is presented in Table LXVIII.
Group I includes 37 cases positive for hemolytic streptococci on admission.
(a) Twenty-two of these remained positive throughout the period of observation. Four patients
became negative after one or two weeks and later showed positive findings, leaving the hospital as
positives. These are classified as “irregular.” The results of culture were as follows: Cultured once only,
7; positive after one week, 7; positive after two weeks, 6; positive after three weeks, 2; irregular, 4.
Table LXVIII

Results of Throat Cultures in 242 Hospital Patients Identified as “Carriers” of Hemolytic Streptococci; Cultures Taken at Weekly Intervals

GROUP 1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10th 11th 12th No. of No. with
Culture Culture Culture Culture Culture Culture Culture Culture Culture Culture Culture Culture Contact Acute Hem
“Carriers.” Strep.
Complicatio
I 37 Cases
+ 7
+ + 7
+ + + 6
+ + + + 2
+ − 8
+ − − 1
+ − − − − 1
+ + − 1
+ − + 2
+ − − − − + + + 1
+ + − − + + + 1
II 67 Cases
− + 26
− + + 12
− + + + 2
− + − 9
− + − − 0
− + + − 2
− + + + + − − + − 1
− + − + 2
III 74 Cases
− − + 38
− − + + 5
− − + + + 4
− − + + + + 0
− − + − − − 0
− − + − 4
− − + + − − − − 1
− − + + − 0
− − + + − − − 1
− − + + + + − 0
− − + − + 1
− − + − + + 2
− − + − + + + 1
− − + − − + + 1
− − + + + − − + 1
IV 34 Cases
− − − + 12
− − − + + 5
− − − + + + 4
− − − + − 3
− − − + − − 1
− − − + + − 1
− − − + + + − 1
− − − + − − + + 1
− − − + + − − − − − 0
V 16 Cases
− − − − + 1
− − − − + + 1
− − − − + − 3
− − − − + − − − 0
− − − − + − − − − − 1
− − − − + + − 1
− − − − + − + 2
− − − − + + − + 1
− − − − + + − − − + 1
VI 7 Cases
− − − − − + 1
− − − − − + + 2
− − − − − + − 3
− − − − − + − − 1
VII 4 Cases
− − − − − − + 2
− − − − − − + + 1
− − − − − − + − − − − − 1
VIII 3 Cases
− − − − − − − + 2
− − − − − − − + + + 1

(b) Eleven of the patients entering as positives became negative, 10 after one week and 1 after two
weeks.
This group of cases furnishes no data concerning the duration of the “carrier” state, since all cases
were positive when first observed. In 30 per cent of instances, hemolytic streptococci disappeared
within the first two weeks of observation.
Groups II to VIII include 205 patients who became positive at some time during their stay in the
hospital. The arrangement in groups depends upon the length of time the patients remained in the
hospital before acquiring S. hemolyticus. Ninety-five of these patients had no further cultures after the
initial positive culture. Fourteen appear as “irregular,” as defined above. These two classes of cases are
omitted in the following summary of these groups. The initial positive culture is arbitrarily considered
the day of infection and subsequent cultures mark off weekly intervals.
(a) Thirty-nine patients had acute infections due to hemolytic streptococci. Thirteen of these patients
passed from observation after their initial positive culture. The cases with repeated cultures after initial
positive may be summarized as in Table LXIX.
Table LXIX

NO. PATIENTS NO. BECOMING PER CENT


CULTURED NEGATIVE BECOMING
NEGATIVE
Recultured after one week 26 7 26.9
Recultured after two weeks 14 8 57.1
Recultured after three weeks 7 4 57.1
Recultured after four weeks 2 2 100.0
The records within this small group of cases indicate that hemolytic streptococci tend to disappear
with the passing of the acute infection.
(b) One hundred and sixty-six contact “carriers” are included in Groups II to VIII. Eighty-two of these
passed from observation after their initial positive culture and 14 appear as “irregular.” The cases with
repeated throat cultures after the initial positive are summarized in Table LXX.
Table LXX

NO. PATIENTS NO. BECOMING PER CENT


CULTURED NEGATIVE BECOMING
NEGATIVE
Recultured after one week 70 26 37.1
Recultured after two weeks 22 9 40.9
Recultured after three weeks 5 5 100.0
Recultured after four weeks 4 4 100.0
These records indicate that contact carriers in great part harbor hemolytic streptococci during short
intervals. A longer period of observation after the disappearance of hemolytic streptococci would have
been desirable in many instances. Some patients were followed with consistently negative cultures
during three, four and five weeks after hemolytic streptococci had disappeared.
It is difficult to explain those instances in which negative cultures are interposed between positives.
Where one negative interrupts positive cultures, it is possible that the throat culture failed to
demonstrate hemolytic streptococci which were present. Such cases in this series fall within the limits of
the percentage error of throat culture identification. Where two or three, or even four negative cultures
intervene, reinfection is not impossible.
Relation of S. Hemolyticus “Carriers” to the Complications of Acute Respiratory Diseases.
—In the present study of measles it has been shown that pneumonia following measles has been no
more common in “carriers” than in “noncarriers.” Nevertheless, pneumonia occurring in badly infected
wards has been modified by streptococcus complications.
More cases of otitis media have appeared in “carriers” than in “noncarriers.” The possibility that mild
otitis media, which would ordinarily pass unnoticed, might become evident as the result of
streptococcus invasion must be considered. Levy and Alexander have made an important contribution to
our knowledge of the rôle of hemolytic streptococci in measles. They find that “carriers” of hemolytic
streptococci among measles patients are especially predisposed to complications following measles.
Their cases were drawn from a camp population highly saturated with S. hemolyticus “carriers.” In the
organization from which 89 per cent of their patients with measles came, there were 83 per cent
hemolyticus “carriers” among men on duty. Among patients with measles, throat cultures were positive
for hemolytic streptococci on admission in 77 per cent. It is evident that all patients with measles have
been exposed to hemolytic streptococci during the first day or two after admission. Failure to carry
streptococcus would appear to be dependent upon ability to resist it rather than upon lack of
opportunity for acquiring it. Of 388 cases observed by Levy and Alexander only 79 were “noncarriers” of
hemolytic streptococci on admission, and of these, 27 became positive while under observation; only 52
remain as “noncarriers” of hemolytic streptococci. This small group must be regarded as a highly
selected one, composed of individuals more than ordinarily resistant to hemolytic streptococci and
perhaps to all complications of measles. The chances are that these 52 cases placed under any
circumstances might very well have been among the large number of measles cases in which no
complications develop.
Furthermore, it is not unlikely that any complication of measles may be modified by a streptococcus
secondarily when about 85 per cent of the cases show S. hemolyticus in the throat. The complications
in the cases of Alexander and Levy appear to have been caused in large part by streptococcus, but a
complete bacteriologic study of them is not recorded. Complications among streptococcus “carriers” are
not identical with complications due to the streptococcus, and it is desirable to know what percentage of
complications actually due to hemolytic streptococci occurred among the 85 per cent of patients with
measles who carried hemolytic streptococci.
Summary.—No hemolytic streptococcus complications occurred in 112 cases of measles observed at
Ft. Riley, among which streptococcus “carriers” rose from 2.6 per cent on admission to 24.1 per cent
before discharge from the hospital. The percentage of “carriers” of hemolytic streptococci among
normal men in the camp supplying these cases was about 25.5 per cent.
The influenza epidemic and a small epidemic of measles occurred in part simultaneously at Camp Pike
during September and October, 1918. The complications following measles at Camp Pike were to a
considerable extent dependent upon the combined effects of influenza and measles.
Thirty-five per cent of the measles patients showed throat cultures positive for B. influenzæ on
admission to the hospital. On repeated cultures, this rose to 84 per cent before discharge.
Ward separation of cases of measles carrying hemolytic streptococci in their throats and cases not
carrying these organisms were practiced in handling this epidemic. Of 867 cases of measles treated in
this manner, 37 were positive for hemolytic streptococci on admission, and 205 developed positive
throat cultures for these organisms during their period of observation in the hospital.
At Camp Pike, the percentage incidence of S. hemolyticus “carriers,” on admission to the measles
wards, was 4.2 per cent. In cases recultured after one week, it was 10.9 per cent; after two weeks 22.8
per cent; after three weeks 26.2 per cent; and after four weeks 33.1 per cent. The weekly development
of “carriers” in the “clean” treatment wards was during the first week 9.1 per cent; during the second
week 17.4 per cent; during the third week 17.4 per cent; and during the fourth week 17.4 per cent.
The principal complications of these 867 cases of measles at Camp Pike were: pneumonia, 56 cases;
otitis media, 48 cases, with subsequent mastoiditis in 23 cases, 2 of which had extensions to the
meninges and brain. The greater part of the pneumonia occurred early in the period of observation,
while most of the otitis media occurred later. Incidence of hemolytic streptococci was low during the
pneumonia period and high during the prevalence of otitis media.
Hemolytic streptococci complicated 9 of these pneumonias; caused a large percentage of otitis
(bacteriology incomplete), and 21 of the 23 cases of mastoiditis.
The bacteriology of 35 of the 56 pneumonias showed: Pneumococcus Type II atypical, in 36 per cent,
Type IV in 22.9 per cent, Type I in 2.8 per cent and Type III in 2.8 per cent; hemolytic streptococci in
22.4 per cent; and B. influenzæ in 88.6 per cent.
The culturing of wards as units revealed widespread contact dissemination of hemolytic streptococci,
at times 25 to 50 per cent of the patients in a ward becoming “carriers” within the period of a week.
Streptococcus pneumonias, otitis media and its complications were furnished in large part by wards in
which active dissemination occurred.
Streptococcus complications did not occur among 37 patients who were “carriers” of hemolytic
streptococci when admitted to the hospital.
The epidemic dissemination of hemolytic streptococci occurs in measles wards, and is a serious
danger. Many, patients whose throats become infected, develop no symptoms. In some instances
streptococcus invades, and renders much more serious lesions caused by other microorganisms.
Methods to prevent transfer of infection within the ward and separation of “carriers” from
“noncarriers” in different wards are efficient in keeping epidemic dissemination of hemolytic streptococci
under control. Frequent throat cultures and prompt report of the results of cultures are essential.
The dissemination of B. influenzæ in patients with measles was not controlled by segregation of
“carriers” and “noncarriers” of this organism as identified by throat cultures in separate wards.
CHAPTER VI
THE PATHOLOGY AND BACTERIOLOGY OF PNEUMONIA FOLLOWING
MEASLES

Eugene L. Opie, M.D.; Francis G. Blake, M.D.; James C. Small, M.D.; and Thomas M. Rivers, M.D.

Among 18 autopsies upon men who have died with pneumonia following measles there are
pulmonary lesions representing almost every type of pneumonia which has been found in association
with influenza. In most instances pneumonia made its appearance during the second week of measles
and death occurred during the third week. Of 16 instances in which the record is definite, pneumonia
had its onset during the first week of measles in 4 instances, during the second week in 11 instances,
and in one instance (Autopsy 390) perhaps not referable to measles in the fifth week. The duration of
pneumonia varied from three to thirty-two days; in 10 instances it did not exceed one week, in 5
instances it was between one and two weeks and in one instance, thirty-two days. When the duration of
pneumonia exceeded ten days some evidence of chronic pulmonary disease was found at autopsy.
The same lack of correspondence between clinical diagnosis and pulmonary lesions noted with
influenza was found following measles. In accordance with the prevailing opinion concerning the
character of pneumonia following measles, the diagnosis of bronchopneumonia was made in 13
instances and in all of these cases bronchopneumonia was found at autopsy. The diagnosis of lobar
pneumonia was made 5 times and was correct only once. Nevertheless, lobar pneumonia was present 4
times, but was recognized only once (Autopsy 486.) Failure to recognize lobar pneumonia, was
doubtless due in part at least to its association with purulent bronchitis and peribronchiolar pneumonia
(Table LXXI).
NO. OF RACE LENGTH DURATION DURATION CLINICAL PURULENT LOBAR PERIBRONCHIOLAR HEMORRHAGIC
AUTOPSY OF OF OF DIAGNOSIS BRONCHITIS PNEUMONIA CONSOLIDATION PERIBRONCHIOLAR
MILITARY ILLNESS PNEUMONIA CONSOL.
SERVICE
390 W 1m. 35 6 L M

438 W 2m. 22 12? B P +

439 W 10d. 14 11? B P M +

441 W 1m. 16 11 B P + +

442 W 1m. 17 2+ L P M

443 W 21d. 23 14 B P +

444 W 1m. 9 3 B P M +

450 W 29d. 19 5 B + M

453 W 36d. 13 6 B P +

481 W 54d. 4+ 3? B P +

484 W 42d. 20 7 B P +

486 C 6d. 17 8 L P +

491 W 2m. 19 5 B +

492 W 49d. 20? 11? L P M +

496 W 1m. 43 32 L P +

505 C 4m. 16 6 B P +

507 C 5m. 14 3 B

508 C 2m. 16 5 B + M

Changes in Bronchi.—The changes in the bronchi do not differ in character from those associated
with pneumonia following influenza. Purulent bronchitis recognized at autopsy by the presence of
mucopurulent material in the small bronchi was found in a much larger proportion of instances in this
group of autopsies occurring in 13 of 18 instances (72.2 per cent), whereas it was present in only 55.6
per cent of autopsies on individuals with pneumonia following influenza. There was peribronchial
hemorrhage recognizable on gross examination in 3 autopsies and microscopically in 3 additional
instances.
Bronchiectasis was present in a considerable proportion of these autopsies, dilatation of bronchi being
noted in 7, but it was usually moderately advanced and at times limited to the bases of the lungs. The
short duration of respiratory disease perhaps explains the infrequency of advanced bronchiectasis. The
incidence of the lesion is greater with measles (43.7 per cent) than with influenza (22.4 per cent).
Microscopic changes in the bronchi do not differ from those found after influenza. Evidence of acute
inflammation, often hemorrhagic in character, is found within the lumen of the bronchus and in the
tissues immediately in contact with the lumen. Not infrequently the epithelium is lost; there is superficial
necrosis and deposition of fibrin upon the surface and within the tissue. In the deeper tissues of the
bronchial wall there is infiltration with lymphoid and plasma cells, which in the larger bronchi is
particularly advanced about the mucous glands of which the acini exhibit degenerative changes. With
the onset of chronic changes new formation of fibrous tissue occurs in the wall of the bronchus and in
the contiguous interalveolar walls. The lining epithelium often loses its columnar cells and assumes a
squamous type.
Changes in the bronchi with bronchiectasis have been similar to those following influenza. Weakening
of the wall permitting dilatation is brought about by necrosis extending outward from the lumen a
varying distance into the bronchial wall and permitting the formation tears which diminish resistance to
intrabronchial pressure.
Lobar Pneumonia.—Lobar pneumonia following measles occurred in 4 instances. Onset in these
cases was on approximately the 9th, 10th, 11th, or 14th day of measles; the onset of
bronchopneumonia bore a similar time relation to the onset of measles, the average interval being nine
days. Hepatization with lobar pneumonia was in 1 instance red, in 3 instances gray, and in all save 1
instance the consolidation was firm and coarsely granular on section. In the exceptional instance the
greater part of the right upper lobe was laxly consolidated and rather finely granular but the microscopic
appearance was in all instances that of lobar pneumonia. Lobar pneumonia in 2 of these cases was
associated with purulent bronchitis present in parts of the lung that had not undergone consolidation,
whereas in the other 2 instances there were acute bronchitis and peribronchiolar pneumonia recognized
by microscopic examination.
In one instance hepatization of the lung presented some noteworthy features.
Autopsy 450.—G. D., white, aged twenty-one, a farmer, resident of Arkansas, had been in military service twenty-nine
days. Onset of illness began on October 2, nineteen days before death, and on admission on the same day the diagnosis of
measles was made. Signs of pneumonia, regarded as bronchopneumonia, were recognized five days before death. Three
days later there was otitis media and paracentesis was performed. On October 3 and 10 neither S. hemolyticus nor B.
influenzæ was found in the sputum; on October 17 and 20 S. hemolyticus was not found but B. influenzæ was present.
Anatomic Diagnosis.—Acute lobar pneumonia with gray and red hepatization in right upper and lower lobes; edema and
peribronchial hemorrhage in left lung.

Fig. 29.—Lobar pneumonia following


measles, showing extension of gray
hepatization from lower to upper
lobe through a defect in the septum
separating the two lobes. Autopsy
450.

The entire lower lobe of the right lung (Fig. 29) with the exception of a narrow air-containing zone in contact with basal
surface is firmly consolidated. The greater part of the consolidated tissue is yellowish gray, firm and coarsely granular. The
uppermost part of the consolidated tissue is softer than elsewhere as if it has undergone autolysis. The lowermost part of
the consolidated tissue in a zone from 2.5 to 3.5 cm. in breadth is firmly consolidated but deep red. The bronchi contain stiff
plugs of fibrin. In the upper lobe continuous with the consolidated part of the lower is a semicircular patch of yellowish gray
consolidation. It overlies the line of the interlobular cleft at the site of a break in its continuity. Consolidation appears to have
spread from the lower lobe into the upper at the site where the alveolar tissue of the two lobes is continuous but is absent
from that part of the upper lobe separated from the lower by the interlobular cleft. This semicircular patch of yellowish gray
consolidation is separated from air containing tissue of the upper lobe by a zone of red hepatization about 1 cm. in thickness.
Bacteriologic examination showed the presence of Pneumococcus IV in the blood of the heart; B. influenzæ alone was
obtained from the right lower lobe and B. influenzæ and staphylococcus from the left main bronchus.
The distribution of lobar pneumonia in the foregoing autopsy indicates that it has spread like a wave
from the upper part of the lower lobe (Fig. 32) penetrating into the upper where the alveolar tissue of
the two lobes is in contact; gray hepatization is everywhere separated from air containing tissue by an
advancing zone of red hepatization.
It may be assumed that lobar pneumonia was caused by Pneumococcus II atypical in 3 instances
although it was recovered from the lungs only twice, for in the third instance (Autopsy 486) it was found
in the bronchus and in the inflamed pleural cavity; pneumococci were doubtless previously present in
the lung, but had disappeared at least from that part from which the culture was made. Pneumococcus
IV was evidently the cause of pneumonia in 1 instance (Autopsy 450), for it was found in the blood of
the heart although it was absent in the culture from the lung.
Little significance can be attributed to the observation that B. influenzæ was present in pure culture in
the lungs from Autopsies 450 and 486, for the presence of Pneumococci IV in the blood of the heart in
Autopsy 450 and of Pneumococcus II atypical in the pleura in Autopsy 486 furnishes evidence in view of
the occurrence of lobar pneumonia that pneumococci had disappeared from the lungs. B. influenzæ was
found both in the lungs and bronchus or in the bronchus alone in 3 of these 4 cases.
The relation of hemolytic streptococci to the lesion is of interest. In 3 of 4 instances of lobar
pneumonia this microorganism had entered the bronchi but was not found in the lungs or in the heart’s
blood; and gross and histologic examination showed none of the lesions which are usually caused by it.
In 1 instance (Autopsy 508) hemolytic streptococci, absent from the throat when the patient was
admitted to the hospital with measles sixteen days before death, appeared in a culture made five days
later and was subsequently found three times; it had penetrated into the bronchus but failed to reach
the lung. Observations made upon lobar pneumonia following influenza have shown the relative
insusceptibility of lobar pneumonia with gray hepatization to secondary infection with hemolytic
streptococci (p. 160). Autopsy 508 demonstrates that occurrence of hemolytic streptococci in the
sputum of a patient with pneumonia does not furnish conclusive proof of the existence of streptococcus
pneumonia.
Bronchopneumonia.—Bronchopneumonia has been found in every instance of pneumonia following
measles save 3, namely in Autopsy 486, Autopsy 505 with lobar pneumonia and Autopsy 507 with
interstitial suppurative pneumonia. It is not improbable that further histologic study might have
demonstrated small patches of peribronchiolar pneumonia, for purulent bronchitis was present in the
two autopsies with lobar pneumonia. This small group of cases has reproduced all of the important
features of bronchopneumonia following influenza. Hemorrhagic peribronchiolar consolidation
characterized by the presence of small gray spots clustered about terminal bronchi upon a
homogeneously red background has been found in 5 of 18 instances of pneumonia with measles.
Pfeiffer regarded this lesion as characteristic of the pneumonia of influenza. Peribronchiolar patches of
consolidation with no surrounding hemorrhage were found in 14 instances, being recognized first by
microscopic examination in half of this number. Lobular consolidation occurred in 11 autopsies and
peribronchial fibrinous pneumonia was present in a third of the autopsies on patients with pneumonia of
measles.
Bronchial, peribronchial and intraalveolar hemorrhage is much more commonly associated with the
pneumonias of influenza than with the more familiar types of acute bronchopneumonia. Exuded blood
may undergo absorption; and with bronchopneumonia which, persisting unresolved, has assumed the
characters of a chronic lesion, it is common to find mononuclear cells often in great abundance filled
with brown pigment derived from the hemoglobin of red blood corpuscles.
Autopsy 439 is an example of acute hemorrhagic bronchopneumonia; there are red lobular and
confluent lobular patches of consolidation which upon the pleural surface have a blue or purplish color.
In the dependent part of the left lung occupying a large part of the lower lobe there is lax, red
consolidation marked by gray or yellowish gray spots of peribronchiolar pneumonia and in this lobe
bronchi are encircled by zones of hemorrhage. Pneumococcus II atypical was obtained from the lung. In
Autopsy 444 the lesion has the same hemorrhagic character although lobular patches are in a stage of
grayish red hepatization. Pneumococcus II atypical has been found in the heart’s blood, and with B.
influenzæ in lungs and bronchus. Autopsy 441 is an example of the occurrence of conspicuous nodules
of peribronchiolar consolidation in some parts of the lungs with the same lesion in other parts on a
background of hemorrhage. B. influenzæ and S. aureus have been found in both lungs and bronchi.
Steinhaus[102] states that the pneumonia of measles is never lobular inflammation but occurs in small
patches several of which may be found in a single lobule.
Chronic fibroid pneumonia following measles characterized by cellular infiltration and proliferation of
the interstitial tissue of the lung has been described by Bartels,[103] Steinhaus,[104] Hart,[105]
MacCallum[104] and others.

Fig. 30.—Unresolved bronchopneumonia with measles


showing new formation of fibrous tissue about a bronchus and
in immediately adjacent alveolar walls; partially obliterated
alveoli occur in the peribronchial fibrous tissue. Autopsy 481.

Fig. 31.—Unresolved bronchopneumonia with measles


showing a nodule of chronic fibrous pneumonia surrounding a
respiratory bronchiole. Autopsy 481.
The incidence of unresolved bronchopneumonia among instances of bronchopneumonia following
measles is higher than that among bronchopneumonias following influenza. There have been 6
instances of chronic or unresolved bronchopneumonia among 18 pneumonias following measles, namely
33.3 per cent. The incidence of unresolved bronchopneumonia among 241 autopsies on pneumonia
following influenza has been 21, namely 8.7 per cent. The essential features of this chronic lesion have
been as follows: (a) chronic peribronchiolar pneumonia indicated by the presence of firm nodules of
peribronchiolar consolidation which have considerable resemblance to miliary tubercles. Induration of
the nodule occurs because the walls of alveoli surrounding and adjacent to a respiratory bronchiole (Fig.
31) become thickened and infiltrated with cells and there is organization of exudate within the alveoli.
New formation of fibrous tissue (Fig. 32) occurs where the acute inflammatory reaction of
peribronchiolar consolidation is most advanced (p. 169 and compare with Figs. 3 and 4), namely, about
the respiratory bronchiole, alveolar duct and the proximal parts of the infundibula, disappearing as the
distal half of the infundibulum is approached. Distention of the alveoli explaining the distention of the
lung and its failure to collapse on section is a noteworthy feature of the lesion. (b) Chronic peribronchial
inflammation (Fig. 30) with new formation of fibrous tissue about the smaller and medium-sized bronchi
extending into immediately adjacent alveolar walls and often associated with organization of
peribronchial fibrinous pneumonia. (c) Chronic lobular inflammation with changes similar to those just
cited, distributed throughout entire lobules. (d) Moderate thickening of interlobular septa. Bronchiectasis
may be associated with the chronic lesion (Autopsies 443, 481, 484, 492 and 496) but with one
exception (Autopsy 443) has been only moderately advanced. Suppurative pneumonia with abscess
formation has occurred twice (Autopsies 438 and 492).

Fig. 32.—Unresolved bronchopneumonia with measles


showing chronic pneumonia about a respiratory bronchiole
and alveolar duct; alveoli about the proximal parts of three
distended infundibula are filled with polynuclear leucocytes,
whereas inflammatory changes disappear as the distal parts of
the infundibula are approached. Autopsy 481.

With acute bronchopneumonia following measles the average duration of pneumonia, determined by
the date upon which physical signs of pneumonia were first recognized and in consequence subject to
some error, was seven days; in instances of chronic bronchopneumonia the average duration of
pneumonia has been fifteen days.
The bacteriology of acute bronchopneumonia following measles is shown in Table LXXII.
Table LXXII

WITH NO SPUTUM BACTERIA IN BLOOD BACTERIA IN LUNGS BACTERIA IN BRONCHI


SUPPURATION IN LIFE OF HEART
Autopsy 390 Pneum. II atyp.
439 0 Pneum. II atyp. S. aur. B. coli
441 0 B. inf., S. aur. B. inf., S. aur.
444 B. inf. Pneum. II atyp. Pneum. II atyp. B. inf. Pneum. II atyp. B. inf.
453 Pneum. I Pneum. I Pneum. I, B. inf.
With suppuration:
442 S. hem. S. hem. B. inf., S. hem.
491 S. hem. S. hem. S. hem., B. coli B. inf., B. coli
507 S. hem. S. hem. S. hem., S. aur. S. hem., B. inf., S. aur.
It is noteworthy that pneumococci have been recovered from the heart’s blood or lung in all but 1
(Autopsy 441) of 5 instances of acute bronchopneumonia with no suppuration and is doubtless the
cause of this pneumonia. Pneumococcus II atypical has been found in 3 of 4 instances of lobar
pneumonia following measles and is present in 3 of these 5 instances of bronchopneumonia.
Where suppuration has been found, hemolytic streptococci have been present in the sputum, in the
heart’s blood and either in the lungs (Autopsy 491) or in the bronchi (Autopsy 442) or in both (Autopsy
507). In these instances pneumococci have not been found, though in view of the readiness with which
pneumococci disappear from the lungs it is possible that they have been the primary cause of
bronchopneumonia.
The bacteriology of 6 instances of unresolved bronchopneumonia following measles is given in Table
LXXIII.
Table LXXIII

WITH NO SPUTUM BACTERIA IN BLOOD BACTERIA IN LUNGS BACTERIA IN BRONCHUS


SUPPURATION IN LIFE OF HEART
Autopsy 443 0 B. coli B. inf., B.coli
481 0 B. inf. B. inf., Pneum. II, atyp., S.
hem.
484 Pneum. 0 0 B. inf., diphtheroids
IV., B.
inf.
496 Pneum. 0 0 B. inf.
IV., B.
inf.
With Suppuration:
Autopsy 438 B. inf. 0 Pneum. II atyp., S. vir. B. S. hem., B. inf.
inf. S. hem.
492 St. hem., S. hem. S. hem., Pneum. IV, B. coli,
B. inf. B. inf.
Whereas with acute bronchopneumonia death has been accompanied and perhaps caused by
bacterial invasion of the blood by pneumococci or streptococci in 5 of 7 instances, with unresolved or
chronic bronchopneumonia, bacteriemia has been present only once, namely, in Autopsy 492 in which
with suppurative pneumonia hemolytic streptococci have entered the blood. It is probable that
pneumococci have likewise had an important part in the causation in these instances of
bronchopneumonia which have run a chronic course but in all save 2 cases (Autopsies 438 and 492)
have disappeared from the lungs. Pneumococcus II atypical has been found twice.
B. influenzæ has been found in association with acute bronchopneumonia in the lungs in 1 of 6
examinations and in the bronchi in 5 of 6 examinations. These figures indicate that it is present in small
numbers if at all in the consolidated lung tissue but is relatively abundant in the bronchi. With chronic
bronchopneumonia B. influenzæ has been found in every instance, in half of the examinations of lungs
and in all of the examinations of bronchi. In 1 instance (Autopsy 481) B. influenzæ has been found in
pure culture in the lung; Pneumococcus II atypical has been found in the bronchus and has perhaps
disappeared from the pneumonic lung, since this microorganism is often destroyed in the late stages of
pneumonia so that its demonstration at autopsy is no longer possible. In 1 instance B. influenzæ found
in the bronchus has been the only microorganism isolated at autopsy, although the sputum during life
contained B. influenzæ and Pneumococcus IV.
Suppurative Pneumonia.—Suppurative pneumonia with formation of abscesses has occurred in 2
autopsies with pneumonia following measles (Autopsies 438 and 492), both instances of chronic
bronchopneumonia. In Autopsy 438 the lower and posterior part of the left lower lobe has been
consolidated and has had on section a cloudy, grayish red color; within this area of consolidation and
immediately below the pleural surface there have been opaque, yellow spots where the tissue has been
softer than elsewhere. Microscopic examination shows that the tissue has here undergone widespread
necrosis so that all nuclear stain has disappeared; at the edges of the necrotic tissue polynuclear
leucocytes are often present in large numbers, but necrosis is much more conspicuous than
suppuration. In the necrotic tissue and at its edges streptococci are present in vast numbers. Hemolytic
streptococci have been grown both from the lung and from the bronchus, but these have not been the
only microorganisms present, for Pneumococcus II atypical and S. viridans have been obtained from the
lungs and B. influenzæ from lungs and bronchus.
In Autopsy 492 with chronic bronchopneumonia the posterior half of the right lower lobe is laxly
consolidated, deep red in color and with the cloudy appearance often associated with streptococcus
pneumonia; upon this background are peribronchiolar spots of yellow color, in places well seen below
the pleura; in the corresponding part of the left lower lobe similar nodules have been converted into
small abscesses by central suppuration. There is empyema on the right side, fibrinopurulent pericarditis,
and purulent peritonitis. Hemolytic streptococci had been found in the sputum three times, the first
examination being thirteen days before death. This microorganism is found in pure culture in the blood
of the heart and with Pneumococci IV, B. coli and B. influenzæ in the lung. Hemolytic streptococci were
found in the right pleural exudate and peritoneum.
The pneumonias following measles give opportunity to consider the relationship of suppurative
interstitial pneumonia to unresolved or chronic bronchopneumonia, which is characterized by infiltration
and proliferation of the fibrous tissue of the lungs. A number of those who have studied the pneumonia
of measles have recognized that this chronic interstitial lesion is a common sequela of measles.
MacCallum has designated the lesion “interstitial bronchopneumonia,” and has included under this name
its acute stage in which the interstitial character of the lesion is not more evident than with other forms
of acute bronchopneumonia. He has regarded S. hemolyticus as the cause of “interstitial
bronchopneumonia” following measles. A review of the autopsies which he has described shows that he
has included under the same designation typical instances of interstitial suppurative pneumonia
associated with suppurative lymphangitis. Instances of unresolved, chronic or “interstitial”
bronchopneumonia and of interstitial suppurative pneumonia which we have observed after measles,
demonstrate that the two lesions are distinguishable both by their anatomic characters and by their
etiology.
Three instances of suppurative interstitial pneumonia occurred among the pneumonias following
measles (Autopsies 442, 491 and 507). The lesion is characterized by suppuration of the interlobular
septa and particularly noteworthy is the occurrence of suppurative lymphangitis, lymphatics being
immensely dilated and distended with purulent fluid so that their irregularly dilated, beaded appearance
is recognizable upon the section of the lung. In the group of pneumonias following measles this lesion
has not been associated with unresolved or chronic bronchopneumonia; no nodular tubercle-like foci of
bronchopneumonia have been found at autopsy, and there has been no thickening of the interstitial
tissue. The lesion has accompanied confluent lobular pneumonia in 2 instances (Autopsies 442 and
491). In the third instance (Autopsy 507) there was in the neighborhood of the suppurative lesions
diffuse consolidation which had the cloudy, gray red color of streptococcus pneumonia, but this
consolidation was not lobular in distribution.
The etiology of interstitial suppurative pneumonia established by study of instances following
influenza is confirmed by Table LXXII (p. 345) showing the bacteriology of instances of acute
bronchopneumonia following measles. Pneumococci are almost invariably found in uncomplicated
instances of bronchopneumonia and hemolytic streptococci have been absent, whereas in 3 instances of
suppurative interstitial pneumonia hemolytic streptococci have been found in the sputum during life, in
pure culture in the blood of the heart and in the lungs and bronchus (missed in the bronchus in one
instance, Autopsy 507). In the 3 instances of the disease B. influenzæ has been found in the bronchi.
Table LXXIII shows that suppuration has accompanied unresolved bronchopneumonia (“interstitial
bronchopneumonia”) in 2 instances (Autopsies 438 and 492), but in these instances the interlobular
tissue of the lung has not been the site of suppuration and there has been no suppurative lymphangitis.
Localized abscesses have been formed; hemolytic streptococci, as with abscesses following influenza,
have been found.
Empyema has occurred only 5 times in association with pneumonia following measles and in these 5
instances has been associated with suppurative pneumonia caused by hemolytic streptococci. In
Autopsy 492 there was fibrinopurulent pleurisy on both sides. Aspiration had been performed 3 times
and at autopsy the right pleural cavity contained 150 c.c. of purulent fluid. In small pockets,
corresponding to shallow oval depressions upon the anterior surface of the lung, fluid was walled off
from the general cavity. The pericardial cavity contained 25 c.c. of turbid yellow fluid containing yellow
flakes of fibrin and the peritoneal cavity contained thick purulent fluid. Hemolytic streptococci present in
the heart’s blood and lung were recovered from the right pleural cavity and from the peritoneum.
Among 3 instances of empyema accompanying interstitial suppurative pneumonia, in 1 (Autopsy 491)
there were walled off pockets of fluid similar to those just described. Aspiration of the right pleural
cavity had been performed 3 times; at autopsy 100 c.c. of fibrinopurulent fluid was found on the right
side and 450 c.c. on the left. There was general purulent peritonitis and the peritoneal cavity contained
350 c.c. of thick yellow pus. Hemolytic streptococci were obtained from the heart’s blood, right lung,
right pleural cavity and peritoneum.
Among 4 instances of lobar pneumonia following measles there was serofibrinous pleurisy 3 times; in
1 instance there is no record of pleural change. In 1 instance of lobar pneumonia (Autopsy 505) the
right pleural cavity contained 800 c.c. of serofibrinous exudate and the pericardial cavity contained 510
c.c. of opaque, yellow seropurulent fluid; Pneumococcus II atypical in pure culture was obtained from
the blood, lung and pleural and pericardial exudates. Among 9 instances of bronchopneumonia following
measles there was fibrinous pleurisy 3 times, serofibrinous 3 times, and no recorded lesion of the pleura
3 times. Empyema, like suppurative pneumonia following measles, is in most instances, but not
constantly, caused by invasion of hemolytic streptococci.
The foregoing study has shown that pneumonia which has followed measles has reproduced all of the
lesions usually found after influenza. There is no pulmonary lesion peculiar to measles. Lobar
pneumonia follows the disease in some instances, but bronchopneumonia with purulent bronchitis is
more common. The same tendency to hemorrhagic inflammation found with the pneumonia of influenza
is seen after measles. Unresolved pneumonia with chronic inflammatory changes in the interstitial tissue
of the lung has all of the characters of the similar lesion following influenza but has been found in a
larger proportion of the pneumonias of measles.
B. influenzæ has been found in the bronchi in 14 of 16 examinations, namely in 87.5 per cent of fatal
instances of pneumonia. In 1 instance in which B. influenzæ has not been found at autopsy, it has been
isolated from the sputum during life. It is not improbable that B. influenzæ has been constantly present
in the inflamed bronchi both after influenza and measles. It is noteworthy that the outbreak of
pneumonia following measles has been in part coincident with, in part slightly subsequent to, an
epidemic of influenza which has exposed every individual in the camp to infection with this disease.
B. influenzæ has been found in the lung with the pneumonia of measles in 7 of 17 examinations,
namely, in 41.2 per cent of instances. The microorganism with measles, as with influenza, is found in
the inflamed lung only half as frequently as in the bronchi. It appears to be peculiarly adapted for
multiplication within the bronchial tubes, and its isolation from the inflamed lung in less than half of the
cases of pneumonia is perhaps referable to its presence in the small bronchi and bronchioles. The
presence of B. influenzæ in the lungs in pure culture in 3 instances at first sight suggests that the
microorganism produces pneumonia, but a more intimate survey of these cases gives little support to
this view. In Autopsy 450 B. influenzæ has been found in pure culture in the lung, but Pneumococcus IV
has been isolated from the blood of the heart and has been with little doubt the cause of typical lobar
pneumonia present in this instance. In Autopsy 486 the condition is almost identical, for in the presence
of lobar pneumonia B. influenzæ has been found in the lung in pure culture, but Pneumococcus II
atypical has been isolated from the pleural cavity and from the bronchus; in both autopsies the
pneumococci which have caused lobar pneumonia have disappeared from that part of the consolidated
lung from which a culture has been made; and here doubtless its invasion has been effectively resisted
although it is still present in other organs. In Autopsy 481 in which B. influenzæ has been isolated from
the lung in pure culture, the part of pneumococci in the production of the fatal disease is less evident;
in this instance, Pneumococcus II atypical, S. hemolyticus and B. influenzæ have been isolated from the
bronchus.
The presence of microorganisms which have a well-established etiologic relation to pneumonia
explains the occurrence of pneumonia and makes unnecessary the assumption that B. influenzæ, which
is present in the lungs in less than half of the instances examined, is essential to the production of the
pneumonic consolidation. In view of the well-recognized etiology of lobar pneumonia we may conclude
that this lesion is referable to the pneumococci (Pneumococcus II atypical in 3 instances and
Pneumococcus IV in 1 instance) isolated from the autopsies in which this lesion occurred.
Pneumococcus (Pneumococcus II atypical in 3 instances and Pneumococcus I in 1 instance) has been
isolated from the lungs or heart’s blood in 4 of 5 instances of acute bronchopneumonia unaccompanied
by suppuration. With unresolved bronchopneumonia with no suppuration, pneumococci have been in no
instance found in the lungs or blood though their presence in the washed sputum during life or in the
bronchus at autopsy suggests the possibility that they may have disappeared from the lungs.
In all instances in which suppuration has occurred hemolytic streptococci have been found in the
lungs or blood, or in both. The occurrence of pneumococci in the lungs in 2 of 5 instances of
suppurative pneumonia indicates that infection with S. hemolyticus is in some instances at least
superimposed upon acute bronchopneumonia caused by pneumococci. Bronchopneumonia in 3
instances has the character of that caused by pneumococci. It is probable that the sequence of infection
frequently observed after influenza, namely, bronchial infection by B. influenzæ, followed by pneumonia
caused by pneumococci, followed in turn by infection by hemolytic streptococci with necrosis or
suppuration, is not uncommon after measles.
Pneumonia Associated with Acute Infectious Diseases Other than Influenza and Measles.
—A small group of autopsies have been excluded from the list of those which accompanied the epidemic
of influenza, because pneumonia has been associated with an acute infectious disease to which it is
perhaps secondary. These few instances of pneumonia, like those following measles reproduce
characters of the pneumonia following influenza and may be in part referable to influenza which has
attacked an individual suffering with typhoid fever, mumps or scarlet fever.
In 2 instances pneumonia followed typhoid fever and appeared on September 23 and 26 shortly after
the epidemic of influenza had become evident. In the following autopsy there was acute lobar
pneumonia which appeared ten days after onset of typhoid fever.
Autopsy 245.—O. H., white, aged twenty-one, a farmer, resident of Oklahoma, had been in military service twenty-one
days. Onset of illness was on September 13 with chill, headache, cough and nausea. The patient was admitted two days
later with the diagnosis of acute bronchitis. On September 20 the abdomen was tense, the spleen was enlarged and rose
spots were present. Signs of lobar pneumonia were found September 23. Death occurred September 25, twelve days after
onset of typhoid fever and two days after recognition of pneumonia.
Anatomic Diagnosis.—Typhoid fever with necrotic ulcers in lower ileum and in colon; hyperplasia of ileocecal lymphatic
nodes; acute splenic tumor; parenchymatous degeneration of liver and kidneys; acute lobar pneumonia with gray
hepatization in left lower lobe and red hepatization and edema in left upper lobe and in right lung; serofibrinous pleurisy on
left side.
The left pleural cavity contains 75 c.c. of yellowish gray turbid fluid. Over the left lower lobe there is a layer of fibrin. The
upper half of the lobe is firmly consolidated, pinkish gray and coarsely granular; the bronchi contain plugs of fibrin. The
lower and posterior part of the lower lobe is consolidated deep red and edematous. The left upper lobe is edematous and a
layer in the lowermost part in contact with the lower lobe is deep red and consolidated. The left lung weighs 1,490 grms.
The lower half of the right upper lobe and the posterior border of the lower is consolidated deep red and edematous; the
lung weighs 970 grms.
Bacteriologic examination shows that the blood of the heart contains Pneumococcus II atypical.
The foregoing autopsy is of interest because typical lobar pneumonia appears to have spread from
the left lower lobe, where consolidation is firm and gray, to the adjacent part of the upper lobe where
consolidation is red and edematous.
The second instance of pneumonia following typhoid fever is an instance of suppurative pneumonia
caused by S. aureus.
Autopsy 329.—J. B., white, aged twenty-two, laborer, resident of Oklahoma, had been in military service two days before
onset of symptoms of typhoid fever. He was admitted to the hospital on August 27 and B. typhosus was found in cultures
from the blood on September 2 and 3. Acute bronchitis appeared on September 26 when the epidemic of influenza had
almost reached its height. A diagnosis of bronchopneumonia was made on the day preceding death, which occurred forty-
one days after onset of typhoid fever and eleven days after onset of bronchitis.
Anatomic Diagnosis.—Typhoid ulcers of ileum; acute splenic tumor; acute bronchopneumonia with red hemorrhagic
peribronchiolar and lobular consolidation in right lung; multiple abscesses forming a circumscribed group in left upper lobe;
purulent bronchitis.
The pleural cavities contain no excess of fluid. The lungs are voluminous and there is interstitial emphysema. Below the
pleura are bluish red spots of lobular consolidation; in the right upper lobe is a large patch of red consolidation marked by
yellowish gray spots in clusters. In the external and upper part of the left upper lobe is a patch of gray consolidation within
which, beneath the pleura, there are small abscesses grouped to form a cluster 1.5 cm, across.
Bacteriologic examination demonstrates no microorganisms in the blood of the heart; of two cultures from the left lung
one contains S. aureus in pure culture, the other S. aureus and a few colonies of Pneumococcus IV. Cultures from the left
main bronchus and from the mucopurulent exudate in a small bronchus both contain B. influenzæ, S. aureus and
Pneumococcus IV.
In the foregoing case bronchitis has appeared thirty days after onset of typhoid fever on September
26, immediately preceding the height of the epidemic of influenza. In association with hemorrhagic
bronchopneumonia there is suppurative pneumonia with small abscesses forming a circumscribed group
below the pleura; there is no empyema. The lesion has the characters of the staphylococcus abscesses
following influenza, and S. aureus is found in association with the lesion; B. influenzæ is identified in
two cultures from the bronchi.
In 2 instances pneumonia was associated with parotitis which was diagnosed mumps.
Autopsy 403.—C. T., colored, aged twenty-five, a laborer, resident of Arkansas, had been in military service one month.
Illness began September 27 with swelling of face behind jaw and difficult mastication; the patient was admitted to the
hospital on the same day with the diagnosis of mumps. Pneumonic consolidation was recognized on October 8. Death
occurred October 13, sixteen days after onset of illness and six days after recognition of pneumonia.
Anatomic Diagnosis.—Acute lobar pneumonia with red and beginning gray hepatization of lower and parts of upper and
middle right lobes; acute bronchopneumonia with lobular consolidation in left lung; purulent bronchitis; bronchiectasis in left
lung.
The lower lobe of the right lung with the exception of the anterior and basal edge is firmly consolidated; the posterior part
of the middle lobe and a small corner at the posterior and lower part of the upper lobe is similarly consolidated. The
consolidated tissue is gray and coarsely granular on section. The remainder of the lung is dry and voluminous, and the
bronchi contain purulent fluid. The left lung contains red and gray patches of consolidation, from 0.2 to 3 cm. across. Bronchi
contain purulent fluid and in the lowermost parts of both upper and lower lobes are moderately dilated.
Bacteriologic examination shows that the blood of the heart contains Pneumococcus III.
It is noteworthy that there was in this case, as in many instances of influenza, both lobar and
bronchopneumonia. Purulent bronchitis was present and there was bronchiectasis throughout one lung.
In the following case the diagnosis of mumps may be questioned since the lesion of the parotid has
characters of terminal suppurative parotitis.
Autopsy 417.—H.W.D., white, aged twenty-four, a farmer, resident of Oklahoma, had been in military service one month.
He said that he had had pneumonia four times. He was admitted to the hospital delirious and the diagnosis of lobar
pneumonia was made. Parotitis regarded as mumps appeared five days before death and suppuration occurred on the right
side of the face. Death of the patient occurred thirteen days after admission to the hospital.
Anatomic Diagnosis.—Acute bronchopneumonia with lobular consolidation in both lungs; suppurative pneumonia with
necrosis and beginning abscess formation in left lung; purulent pleurisy in left side; purulent bronchitis; bronchiectasis; acute
parotitis.
The left pleural cavity contains 100 c.c. of purulent fluid of creamy consistence. The left lung is voluminous and bound to
the chest wall in places. There are numerous patches of lobular consolidation. At the apex of the lung there is a large area of
consolidation, 7 cm. across, where the tissue is cloudy gray and soft in consistence. In the upper lobe is a well-defined patch
of grayish yellow color, 6 by 2 cm., with opaque yellow edges; purulent fluid escapes from the cut surface. Bronchi

You might also like