Ebooks File Murach S Java Servlets and JSP 3rd Edition Edition Joel Murach All Chapters
Ebooks File Murach S Java Servlets and JSP 3rd Edition Edition Joel Murach All Chapters
com
https://ebookgate.com/product/murach-s-java-
servlets-and-jsp-3rd-edition-edition-joel-murach/
https://ebookgate.com/product/murach-s-java-se-6-1st-ed-edition-
joel-murach/
https://ebookgate.com/product/murach-s-c-2010-4th-edition-joel-
murach/
https://ebookgate.com/product/murach-s-html5-and-css3-3rd-
edition-anne-boehm/
https://ebookgate.com/product/murach-s-javascript-2nd-edition-
mary-delamater/
Murach s HTML5 and CSS3 1st Edition Zak Ruvalcaba
https://ebookgate.com/product/murach-s-html5-and-css3-1st-
edition-zak-ruvalcaba/
https://ebookgate.com/product/murach-s-sql-server-2012-for-
developers-1st-edition-bryan-syverson/
https://ebookgate.com/product/developing-java-servlets-2nd-
edition-james-goodwill/
https://ebookgate.com/product/murach-s-ado-net-4-database-
programming-with-vb-2010-4th-edition-anne-boehm/
https://ebookgate.com/product/murach-s-asp-net-4-web-programming-
with-vb-2010-4th-edition-anne-boehm/
I
3RD EDITION
TRAINING & REFERENCE
3RD EDITION
Joel Murach
Michael Urban
10 9 8 7 6 5 4 3 2 1
ISBN-13: 978-1-890774-78-3
Content
Introduction
Appendixes
Appendix A How to set up your PC for this book 691
Appendix B How to set up your Mac for this book 711
••
Expanded contents VI I
Expanded contents
Section 1 Get started right
Chapter 1 An introduction to web applications
A typical web application ............................................................................................... 4
The components of a web application ............................................................................ 6
How static web pages work .............................................................................................8
How dynamic web pages work ..................................................................................... 10
Three approaches for Java web applications ................................ 12
Servlet/JSP .................................................................................................................... 12
JSF ................................................................................................................................. 12
Spring Framework ........................................................................................................ 12
An introduction to servlet/JSP web development ........................ 14
The software components ............................................................................................. 14
The architecture ............................................................................................................ 16
The standard directories and files ................................................................................. 18
Software for developing Java web applications ............................20
IDEs for developing Java web applications .................................................................. 20
Web servers for Java web applications ......................................................................... 22
Database servers for Java web applications .................................................................. 22
Tools for deploying Java web applications ................................................................... 24
• Chapter 3 shows how to use the NetBeans IDE with a Tomcat server to
develop web applications on your own computer. By using this IDE, you'll
learn faster and better than you would without one. In contrast, most
competing books leave you to figure this out on your own.
• Chapter 4 of this book provides a crash course in HTML5 and CSS3. Since
this is essential background for the use of JSPs, this means you won't have
to use a second book to figure out how HTML and CSS work.
• This book includes dozens of examples that range from the simple to
the complex. That way, you can quickly see how a feature works from
the simple examples, but you'll also see how the feature is used in more
complex, real-world examples, including the complete e-commerce
application that's presented in section 5.
• At the end of most chapters, you'll find exercises that help you practice what
you've learned. They also encourage you to experiment and challenge you to
apply what you've learned in new ways. To help you get the most practice in
the least time, you'll start these exercises from existing applications.
• If you page through this book, you'll see that all of the information is
presented in "paired pages," with the essential syntax, guidelines, and
examples on the right page and the perspective and extra explanation on the
left page. This helps you learn faster by reading less... and this is the ideal
reference format when you need to refresh your memory about how to do
something.
• In section 4, you'll learn the advanced servlet and JSP skills that you
will need for certain types of web applications. This includes the use of
JavaMail, SSL, authentication, encryption, HTTP, listeners, and filters.
Then, it ends with an introduction to JavaServer Faces (JSF), an alternate
approach to JSP. Since we designed the chapters in this section to work
independently of each other, you can read them in any order you want. This
makes it easy to learn new skills whenever you need them.
• To complete your Java web programming skills, section 5 presents an
e-commerce website that puts the skills presented in the first four sections
into context. This downloadable application illustrates best practices
and provides code that you can use in your own applications. Once you
understand how this website works, you will have all the skills you need for
creating your own web applications.
Joel Murach
Author
ection
--
I:] Murach'sJava Progammi x
Cl
:=·
n1urach.cor11/books/javp/index.htm
Apps For quick acces�, place your bookmarks here on the bookmark� bar. Import bookmark� now... L] Other bookmarks
"f Jove your Java book. ft cuts :right to the essential information,
provjding the perfect balance betli'een too many details and too
little information. I bought another wel/-knovl'n Java book, but I
spent several hours trying to tearn what r learned from your book
in about 45 minutes." I add book I
I add ebook I
FREE do1Nnload of
sample chapters That's what one developer wrote us about an earlier edition of our
FREE download of the
�ook applications
core Java book. Now, you can expect th1at same practical, time
saving approach in the current edition that covers the latest
I add both I
'.'\/hat soft,,vare you release of Java Standard Edition, Java SE 7 (or JDK 1.7).
More about the eBook
n��r1
Qty Description
Internet
- connection
- I
Description
• Web applications are a type of client/server application. In a client/server applica
tion, a user at a client computer accesses an application at a server computer. For a
web application, the client and server computers are connected via the Internet or
an intranet.
• In a web application, the user works with a web browser at the client computer. The
web browser provides the user interface for the application. One widely used web
browser is Google Chrome, but other web browsers such as Mozilla Firefox and
Internet Explorer are also widely used.
• A web application runs on the server computer under the control of web server
software. The Apache server is one of the most widely used web servers.
• For most web applications, the server computer also runs a database management
system (DBMS), which is also known as a database server. For servlet and JSP
applications, Oracle and MySQL are two of the most popular database management
systems.
HTTP
response
Description
• Hypertext Markup Language (HTML) is the language that the web browser converts
into the web pages of a web application.
• A static web page is an HTML document that's stored in a file and does not change
in response to user input. Static web pages have a filename with an extension of
.htm or .html.
• Hypertext Transfer Protocol (HTTP) is the protocol that web browsers and web
servers use to communicate.
• A web browser requests a page from a web server by sending the server a message
known as an HTTP request. For a static web page, the HTTP request includes the
name of the HTML file that's requested.
• A web server replies to an HTTP request by sending a message known as an HTTP
response back to the browser. For a static web page, the HTTP response includes
the HTML document that's stored in the HTML file.
HTTP
response
Description
• A dynamic web page is an HTML document that's generated by a web applica
tion. Often, the web page changes according to parameters that are sent to the web
application by the web browser.
• When a web server receives a request for a dynamic web page, the server passes
the request to the web application. Then, the application generates a response, such
as an HTML document, and returns it to the web server. The web server, in turn,
wraps the generated HTML document in an HTTP response and sends it back to
the browser.
• Most modern web applications store and retrieve data from a database that runs on
a database server.
• The browser doesn't know or care whether the HTML was retrieved from a static
HTML file or was dynamically generated by the web application. Either way, the
browser displays the HTML document that is returned.
Three approaches
for Java web applications
There are many ways to develop Java web applications. Figure 1-5 describes
three approaches that are commonly used today. When developing Java web
applications, you typically use parts of the Java Enterprise Edition (Java EE)
specification. This specification describes how web servers can interact with all
Java web technologies including servlets, JavaServer Pages (JSP), JavaServer
Faces (JSF), Java Persistence API (JPA), Enterprise JavaBeans (EJB), and more.
Servlet/JSP
In a well-structured servlet/JSP application, servlets store the Java code that
does the server-side processing, and JavaServer Pages (JSPs) store the HTML
that defines the user interface. This HTML typically contains links to CSS and
JavaScript files. To run a web application that uses servlets and JSPs, you only
need to work with the servlet/JSP part of the Java EE specification.
Since the servlet/JSP API is a relatively low-level API, it doesn't do as much
work for the developer as the other two APis. However, the servlet/JSP API gives
the developer a high degree of control over the HTML, CSS, and JavaScript
that's returned to the browser. In addition, the servlet/JSP API is the foundation
for the other two approaches. As a result, it's a good place to get started with
Java web programming. As you progress through this book, you'll learn how to
develop servlet/JSP applications.
JSF
JavaServer Faces (JSF) is a newer technology that's designed to replace
both servlets and JSPs. It provides a higher-level API that does more work for
the programmer. When you use JSF, you typically use more Java EE features
than you do with the servlet/JSP approach.
When you use JSF, you can also use Enterprise JavaBeans (EJBs) to define
server-side components. Although there are some benefits to using EJBs, they're
overkill for most websites. As a result, this book doesn't show how to use them.
Spring Framework
Like JSF, the Spring Framework is a higher-level API that does more work
for the programmer than the servlet/JSP API. However, due to the way it's struc
tured, the Spring Framework still gives the developer a high degree of control
over the HTML/CSS/JavaScript that's returned to the browser. As a result, if
control over HTML/CSS/JavaScript is a priority for your website, the Spring
Framework might be the right approach for you.
Chapter 1 An introduction to web programming with Java 13
Description
• The Java Enterprise Edition (Java EE) specification describes how web servers can
interact with all Java web technologies including servlets, JavaServer Pages (JSP),
JavaServer Faces (JSF), Java Persistence API (JPA), and Enterprise JavaBeans
(EJB).
• In a well-structured servlet/JSP application, servlets store the Java code that does
the server-side processing, and JavaServer Pages (JSPs) store the HTML that
defines the user interface. This typically includes links to the CSS and JavaScript
for the user interface.
• JavaServer Faces (JSF) is a newer technology than servlet/JSP that provides a
higher -level API that replaces both servlets and JSPs. For more on JSF, see chapter
21.
• Java Persistence AP/ (IPA) is an API for working with databases. It can be used
with servlet/JSP, JSF, or Spring. For more on JPA, see chapter 13.
• Enterprise JavaBeans (EJB) can be used to define server-side components. Since
these components are overkill for most websites, they aren't described in this book.
An introduction to servlet/JSP
web development
This topic introduces you to servlet/JSP development. In particular, it pres
ents the software components, application architecture, and standard directories
that you typically use when you develop Java web applications.
HTTP HTTP
request response
Server
Description
• A servlet/JSP application must have a web server and a servlet/JSP engine, also
known as a servlet/JSP container, to process the HTTP request and return an HTTP
response, which is typically an HTML page. Most servlet/JSP applications use
Tomcat as both the web server and the servlet/JSP engine.
• Most servlet/JSP applications use a database to store the data that's used by the
application. Many servlet/JSP applications use MySQL as the database, though
there are many other databases to use.
• For a servlet/JSP engine to work, it must have access to Java's Java Development
Kit (JDK), which comes as part of the Java Standard Edition (Java SE). Among
other things, the JDK contains the core Java class libraries, the Java compiler, and
the Java Runtime Environment (IRE).
The architecture
Figure 1-7 shows the architecture for a typical web application that uses
servlets and JSPs. This architecture uses three layers: (1) the presentation layer,
or user interface layer, (2) the business rules layer, and (3) the data access
layer. In theory, the programmer tries to keep these layers as separate and
independent as possible. In practice, though, these layers are often interrelated,
and that's especially true for the business and data access layers.
The presentation layer consists of HTML pages and JSPs. Typically, a web
designer works on the HTML stored in these pages to create the look and feel of
the user interface. Later, a Java programmer may need to edit these pages so they
work properly with the servlets of the application.
The business rules layer uses servlets to control the flow of the application.
These servlets may call other Java classes to store or retrieve data from a data
base, and they may forward the results to a JSP or to another servlet. Within the
business layer, Java programmers often use a special type of Java class known as
a JavaBean to temporarily store and process data. A JavaBean is typically used
to define a business object such as a User or Invoice object.
The data layer works with the data of the application on the server's disk.
Typically, this data is stored in a relational database such as MySQL. However,
this data can also be stored in text files, binary files, and XML files. Or, it can
come from web services running on the other servers.
Chapter 1 An introduction to web programming with Java 17
Description
• The presentation layer for a typical servlet/JSP web application consists of HTML
pages and JSPs.
• The business rules layer for a typical servlet/JSP web application consists of
servlets. These servlets may call other Java classes including a special type of Java
class known as a JavaBean. As you progress though this book, you'll learn how to
use several special types of tags within a JSP to work with JavaBeans.
• The data access layer for a typical Java web application consists of classes that
read and write data that's stored on the server's disk drive.
• For most web applications, the data is stored in a relational database such as
MySQL. However, it may also be stored in binary files, text files, or XML files.
Description
• The top-level directory for a web application is known as its root directory.
• A Java web application is a hierarchy of directories and files in a standard layout
defined by the Java EE specification. All Java web applications must use the first
three directories that are summarized above.
• To make classes within a JAR file availa ble to more than one web application, you
can put the JAR file in Tomcat's lib directory.
Figure 1-8 The standard directories and files for a servlet/JSP web application
20 Section 1 Get started right
File Edit View Navigate Source Re-factor Run Debug Profile Team Tools Window Help IQ.• Search (Ctrl+I)
do Post - Navigator x I
16
17 String url = "/index.htnl"; -
..-11 ..-1
Q
18
Members <empty> LaJ 19 t/ get c�rre�t act10�
&'.> Emaillistservlet : : HttpServlet 20 String action= request.getParameter("action"); ...
!·· 'ft:>
doGet(HttpSe-rvletRequestrequest, H
L.t:J doPost(HttpServletRequest request, I :===::;::: = ===============
t)
� Emaillistservlet )
Output I Ii
=============== =======:
doPost ) url ) X
�1 rrr J
17:36 I INS
Description
• An Integrated Development Environment (/DE) is a tool that provides all of the
functionality that you need for developing web applications.
• NetBeans and Eclipse are popular IDEs for Java web development that are
open-source and free.
• Chapter 3 shows how to use NetBeans for developing Java web applications. We
recommend using this IDE with this book.
GlassFish
- Is a complete Java EE application server.
- Is free, open-source, and runs on all modern operating systems.
- Provides more features than Tomcat.
- Requires more system resources than Tomcat.
Description
• A servlet/JSP engine is the software that allows a web server to work with the
servlet/JSP part of the Java EE specification.
• Tomcat is one of the most popular servlet/JSP engines. It includes a web server
named Coyote and a servlet/JSP engine named Catalina.
• A Java EE application server is the software that allows the web server to work
with the entire Java EE specification including servlets, JSP (JavaServer Pages),
JSF (JavaServer Faces), JPA (Java Persistence API), EJB (Enterprise JavaBeans),
and so on.
• GlassFish is one of the most popular application servers. It includes a web server, a
servlet/JSP engine that's based on Tomcat's servlet/JSP engine, and more.
• MySQL is one of the most popular database servers.
Figure 1-10 Web and database servers for Java web applications
24 Section 1 Get started right
An ISP that provides web hosting that supports servlets and JSPs
E] JSP Web Hosting and Sel'\ )(
C [j www.mmaweb.net --
•••
:· Apps For quick access, place your bookmarks here on the bookmarks bar. Import bookmarks now ... D Other bookmarks
L I ,--1 $49.99
--.
C-h e- ck j JSP hosting and servlet hosting accounts ·with CCOUNT
per..-.Ch'
advanced, scalable server technologies like Servlets,
Java Server Pages (JSP). Enterprise JavaBeans
(EJB) and XML are what MMA specializes in.
Java Developer Links
The result is a continuous upgrade • Plu, one-month setup fee st
• SeNlets.com
path that lets small businesses ,isJt of first month.
launch websites built on proven
• JsvaWotld
technology that can grow as you
• Official SeNlet Home achieve success without the need
• JsvaSeN!H Pages Home
_.......,_
to rebuild and redeploy your core
I � ·ILC1iltiiJI � -. 13 �I��� n
I Host:
Status:
Respoose:
User.name: Password:
Connection established, waiting for welcome message ...
227 Entering Passive !Mode (72,9,137,30, 138,150)
Port: [ Quick.connect ] r:;l
-
Command: MLSD
Response: 150 Accepted data connection
Respoose: 226-0ptions: ..a�
Response: 226 4 matches total D
Status: !Directory listing successful
m
t-----
" < I Ill
Selected 1 file. Total size: 2,389 Open 2 files.Total size: 3,136 byte.s
Edit
Server/local file Size Priority Status
Create directory
Refresh
Perspective
The goal of this chapter has been to provide the background that you
need for developing servlets and JSPs. Now, if this chapter has succeeded,
you should be ready to learn how to use the MVC pattern to structure a web
application.
Summary
• A web application is a set of web pages that are generated in response to
user requests.
• To run a web application, the client requires a web browser and the server
requires web server software. The server may also require a database
management system (DBMS).
• Hypertext Markup Language (HTML) is the language that the browser
converts into the web pages of a web application, while Hypertext Transfer
Protocol (HTTP) is the protocol that web browsers and web servers use to
communicate.
• A web browser requests a page from a web server by sending an HTTP
request. A web server replies by sending an HTTP response back to the
browser.
• A static web page is generated from an HTML document that doesn't
change, while a dynamic web page is generated by a web application based
on the parameters that are included in the HTTP request.
• The Java Enterprise Edition (Java EE) specification describes how web
servers can interact with all Java web technologies.
• A servlet/JSP engine is the software that allows a web server to work with
the servlet/JSP part of the Java EE specification.
• Tomcat is one of the most popular servlet/JSP engines, and most servlet/JSP
applications use Tomcat as both the web server and the serv let/JSP engine.
• An application server is the software that allows the web server to work
with the entire Java EE specification.
• To run Java web applications, the server requires the Java Development
Kit (JDK), a web server, and a servlet/JSP engine. This allows the server to
process the HTTP request and return an HTTP response.
• Most servlet/JSP applications use a database such as MySQL to store the
data that's used by the application.
• As you develop a Java web application, you try to divide its classes into
three layers: presentation, business rules, and data access. This makes it
easier to maintain the application.
• The top-level directory for a web application is known as its root directory.
Chapter 1 An introduction to web programming with Java 27
Two patterns
for servlet/JSP applications
A pattern is a standard approach that programmers use to solve common
programming problems. This topic describes two patterns that you can use when
you develop Java web applications. However, for a serious web application, most
developers consider the second pattern to be a best practice and recommend
avoiding the first pattern.
Language: English
BY
FREDERICK P. GIBBON
Author of “The Lawrences of the Punjab”
LONDON
PUBLISHED AT THE OFFICES OF “COUNTRY LIFE,” LTD.,
20 TAVISTOCK STREET, COVENT GARDEN, W.C. 2, AND BY
GEORGE NEWNES, LTD., 8-11 SOUTHAMPTON STREET,
STRAND, W.C. 2
NEW YORK: CHARLES SCRIBNER’S SONS
To the
Officers, Warrant Officers,
Non-Commissioned Officers, and Men
of the
42nd (East Lancashire) Division
As their late Commander, I dedicate this history of their
achievements, conspicuous even in days of great deeds, in the hope
that the record of their unchanging spirit of courage, loyalty, and
comradeship may give gratification to survivors and solace to
relatives of the fallen.
11th
November
, 1920.
MAJOR-GENERAL A. SOLLY-FLOOD, C.B., C.M.G., D.S.O.
Field Marshal.
G.H.Q. The Forces in Great Britain,
Horse Guards, London, S.W. 1.
14th July, 1919.
PREFACE
“Sir William Douglas asks me ‘to write a few lines’ to be embodied
in the preface to a history of the 42nd Division.
“In the regions of time and space the Dardanelles enterprise forms
only a trifling part of the record of this famous Division; but, in the
sphere of the imagination, that part will be reckoned by Lancastrians
yet unborn as the most precious heirloom bequeathed to them by
the generation who fought the great war.
“Why? I will give the reasons in the words of a gallant young
Australian killed shortly after he wrote me as follows from the front
in France: ‘I often compare the two situations: out here and on
those wild romantic shores of the Ægean; I compare them and I find
that the Peninsula war stands quite alone and apart, an ineffaceable
memory.’
“Bearing in mind that I am limited to a few lines I propose to think
out nothing new, but to repeat now what was jotted down about a
sample of the 42nd Division at the time (the 4th June, 1915), in my
post of command, shared that day with two enormous tarantulas—
“On the right the French rushed the ‘Haricot’—so long a thorn in
their flesh; next to them the Anson lads stormed another big Turkish
redoubt in a slap-dash style reminding me of the best work of the
old Regular Army; but the boldest and most brilliant exploit of the lot
was the charge made by the Manchester Brigade in the centre who
wrested two lines of trenches from the Turks; and then, carrying
right on to the lower slopes of Achi Baba, had nothing between them
and its summit but the clear, unentrenched hillside. They lay there—
the line of our brave lads, plainly visible to a pair of good glasses—
there they actually lay! We wanted, so it seemed, but a reserve to
advance in their support and carry them right up to the top. We said
—and yet could hardly believe our own words—‘We are through!’
“Alas, too previous that remark. Everything began to go wrong.
First the French were shelled and bombed out of the ‘Haricot’; next
the right of the Naval Division became uncovered and they had to
give way, losing many times more men in the yielding than in the
capture of their ground. Then came the turn of the Manchesters, left
in the lurch, with their right flank hanging in the air. By all the laws
of war they ought to have tumbled back anyhow, but by the laws of
the Manchesters they hung on and declared they could do so for
ever....
General,
“Lieutenant of the Tower of London.”
1st September, 1919.
As the final proofs of the book were being passed, there came the
sad news of the death of the first Divisional Commander, Major-
General Sir William Douglas, K.C.M.G., C.B., D.S.O., at Cultz, near
Aberdeen, on November 2nd, 1920. He had come to be regarded as
the Father of the Division. It was under him that it earned the
distinction of being the first Territorial Division to leave these shores,
and under him it received its baptism of fire. Even when he had
passed from command—both during the war and after hostilities had
ceased—his interest in the welfare of all ranks remained unabated,
and the affection he felt towards them was warmly reciprocated.
In expressing their deep sorrow and their sympathy with Lady
Douglas, the Committee feel that they may speak for all ranks and
all services of the Division.
CONTENTS
CHAP. PAGE
I. LANCASHIRE AND EGYPT (AUGUST 1914—MAY 1915) 1
II. GALLIPOLI (MAY 1915) 19
III. GALLIPOLI (JUNE 1915—JANUARY 1916) 34
IV. THE SUEZ CANAL AND SINAI (JANUARY 1916—MARCH
1917) 63
V. FRANCE (MARCH—AUGUST 1917) 86
VI. YPRES (SEPTEMBER 1917) 97
VII. NIEUPORT (OCTOBER—NOVEMBER 1917) 106
VIII. LA BASSÉE (DECEMBER 1917—MARCH 1918) 114
IX. OPENING OF THE GERMAN OFFENSIVE (MARCH 21—
APRIL 8, 1918) 128
X. ENTR’ACTE (APRIL 9—AUGUST 20, 1918) 142
XI. THE BEGINNING OF THE END (AUGUST 21—
SEPTEMBER 6, 1918) 155
XII. THROUGH THE HINDENBURG LINE (SEPTEMBER 7—30,
1918) 171
XIII. ACROSS THE RIVER SELLE (OCTOBER 9—23, 1918) 179
XIV. FORÊT DE MORMAL AND HAUTMONT (NOVEMBER 3—
11, 1918) 191
ROLL OF HONOUR 200
HONOURS AND AWARDS 232
HEADQUARTERS STAFF AND OFFICERS COMMANDING
UNITS 242
KEY MAP SHEWING APPROXIMATE POSITIONS OF BATTLE FRONTS OCCUPIED BY
THE 42ND DIVISION (E. Lancs. T.)
MOVEMENTS FROM OUTBREAK OF
WAR UNTIL ARMISTICE
1914-1915
Sept.-May British Army of Occupation in Egypt, and
on Suez Canal Defences.
1915-1916
May-Jan. M.E.F. At Cape Helles, Gallipoli Peninsula.
1916-1917 E.E.F. Suez Canal Defences and Sinai Peninsula.
Jan.-Feb. Advance through Romani to El Arish.
1917
Feb. and March B.E.F. Arrived at Marseilles and proceeded to
neighbourhood of Abbéville.
May In the line at Epéhy and Lempire.
June ” ” Havrincourt Wood and
Trescault.
Aug. and Sept. ” ” Ypres.
Sept. ” ” Coast Sector, Nieuport
Bains.
Oct., Nov. ” ” Nieuport and St. Georges.
Nov., Dec., Jan., ” ” Opposite La Bassée.
Feb., 1918
1918
Mar., April ” ” Ervillers, Bucquoy.
May, June, July ” ” Bucquoy, Gommecourt,
Hébuterne.
Aug. Advanced through Miraumont, Riencourt,
Villers-au-Flos.
Sept. ” ” Havrincourt Wood to
Welsh Ridge.
Oct. ” ” Esnes, Beauvois, across
R. Selle.
Nov. ” ” Le Quesnoy, Mormal
Forest to Hautmont.
Nov. 11 Stood fast on line of Maubeuge—Avesnes
Road.
ILLUSTRATIONS
Facing page
MAJOR-GENERAL SIR WM. DOUGLAS, K.C.M.G., C.B.,
D.S.O. Frontispiece
MAJOR-GENERAL A. SOLLY-FLOOD, C.B., C.M.G.,
D.S.O. iv
CAPT. W. T. FORSHAW, V.C., 1/9TH BN. MANCHESTER
REGT. 46
LIEUT. A. V. SMITH, V.C., 1/5TH BN. EAST LANCS.
REGT. 57
PTE. W. MILLS, V.C., 1/10TH BN. MANCHESTER REGT. 116
SGT. E. SMITH, V.C., D.C.M., 1/5TH LANCS. FUS. 157
LC.-CORP. A. WILKINSON, V.C., 1/5TH BN.
MANCHESTER REGT. 187
LIEUT.-COL. P. V. HOLBERTON 131
THE DIVISIONAL COMMANDER AND BRIGADIERS 242
EGYPT AND SUEZ CANAL 18
GALLIPOLI: C. HELLES AND KRITHIA NULLAH SECTOR 19-29
C. HELLES AND GULLY RAVINE SECTOR 48-60
SINAI PENINSULA 76-83
COLOURED PLATE: DIVISIONAL FLASHES 84
BELGIUM: YPRES SECTOR 98-104
NIEUPORT SECTOR 105-108
FRANCE: LA BASSÉE SECTOR 114-118
THE GERMAN OFFENSIVE, MARCH 1918 130-131
GOMMECOURT—HÉBUTERNE SECTOR, APRIL-AUGUST
1918 142
THE BRITISH ADVANCE: MIRAUMONT—TRESCAULT 148-166
” ” THE HINDENBURG LINE 172
” ” ACROSS THE R. SELLE 182-186
” ” FORÊT DE MORMAL AND
HAUTMONT 192
MAPS
KEY MAP x
GALLIPOLI: CAPE HELLES 22
TRENCH MAP 34
FRANCE: THE GERMAN OFFENSIVE, 1918 128
THE BRITISH ADVANCE, 1918, FIRST STAGE 171
” ” ” FINAL STAGE 179
THE 42nd (EAST
LANCASHIRE) DIVISION
CHAPTER I
LANCASHIRE AND EGYPT
(August 1914—May 1915)
For a week or two there had been talk of war and of the likelihood
of England being involved. The prospects and possibilities formed an
interesting topic of conversation and speculation. We leant over the
sheer side of the precipice and caught glimpses of the black chasm
below, but few really doubted the soundness of the fence over which
we peered.
Warnings of disaster had been frequent—but disaster had always
been averted, and fair words had prevailed. For years we had been
living on the verge of national ruin through strikes of railway-men,
transport-workers, miners, or the spinners and weavers of
Lancashire, but at the last moment conciliation always won; there
was always room for compromise. Though civil war in Ireland
seemed imminent, it was comforting to reflect how much common
sense there was in the world. Besides, had it not been proved to
every one’s satisfaction that under modern conditions war between
great nations could not possibly last for more than a month or two,
as in that short period victor and vanquished would alike be reduced
to bankruptcy and impotence? Knowing this no Great Power would
be likely to commit suicide. We were living in the twentieth century,
and a great European war was an abstract conception, not
something that could actually occur.
In the closing days of July 1914 this complacency was giving way
to a very real dread. War might mean suicide even for the victor,
might be “unthinkable,” but it was in sight—plain, stark, menacing.
War such as other nations had known; not a war in which those who
had a taste for soldiering might take part while the rest of us could
read about it in the papers, feel proud of a success and depressed
by a disaster, and wonder whether sixpence would be added to the
income tax. The fantastic image that had thrilled us not altogether
unpleasantly—as children experience ecstatic shudders when
listening to tales of ogres and hobgoblins—was taking on an
appearance of grim reality. Could it after all be a grisly spectre and
not a mere bogey of turnip and white sheet? England began to
regret that the warnings of her greatest soldier had passed
unheeded.
A day or two later Germany flung down her challenge to
Christianity and Civilization, stripped herself of the cloak of decency
and stood revealed in stark brutishness; and on Tuesday, August 4,
1914, England took up the challenge and declared war. The decision
was apparently not expected by the German Staff. To them it was
rather a matter for exasperation than for apprehension. England had
her hands full at home, and her vast possessions would prove a
source of weakness. She had a small regular army, a force with high
traditions, well trained and well equipped for service on the frontiers
of India and other outposts of the Empire, containing a larger
proportion of officers and men with experience of actual fighting
than any other army of the Great Powers, yet so small in numbers
and so scattered over the face of the globe, that one can almost
sympathize with the German belief that the few thousand men who
could be spared from the duty of policing India, Egypt, South Africa,
and other possessions, might safely be regarded as negligible. She
had, too, a small, indifferently trained and equipped, unprofessional,
home-defence force, but even the British themselves did not take
the Territorials seriously.
As to the rest of the potential fighting material of the British Isles,
had it not been proved to the satisfaction of the Germans (who had
made a special study of such matters with the typical Teutonic
thoroughness which works so efficiently when applied to material
facts, and fails so lamentably when the human factor enters) that
the young manhood of the nation was mainly decadent, of poor
physique, weak-chested, half-educated, lacking in patriotic purpose,
with no thought of the morrow and no ideals? With the exception of
the few hundred thousands who had received some training in
physical drill and discipline in the Boys’ Brigade and its daughter-
organizations which teach discipline, self-respect, and esprit de
corps, or in the School Cadet Corps, all were utterly untrained, and
they hated discipline. England had clearly shown that she was too
selfish to submit to any form of compulsory service; too wrapped up
in the love of comfort, ease and luxury to do more than bribe fools
to die for her. It was a nation that had lost its soul. The military aid
she could give to France could be contemptuously brushed aside.
When France had been paralysed and the Channel ports secured,
the British mercantile marine could be sunk or scared off the seas,
and the British Empire brought to its knees.
Teutonic reasoning was wrong. The British character is too simple
or too complex for the Hun. It may be that no other nation brings so
much froth to the top as ours; that none extends such tolerance to
cranks, nor gives so much rope to little cliques of shrieking egoists,
nor shows such stolid indifference when the few, claiming to speak
on behalf of the nation, so egregiously misrepresent her. On August
5, 1914, it was seen that practically every man, woman and child
approved what the Government had done, and felt instinctively that
their country would have been shamed had there been a day’s
hesitation. England had found her soul, not lost it. A nation
supposed to consist largely of pleasure seekers, of lovers of
compromise, conciliation and tolerance, of comfort and luxury, had
decided that all it held most dear would be as dust and ashes if it
stood aside, a passive spectator of the agony of France and Belgium.
Practically without a dissentient voice the nation prepared to
sacrifice its all. Unhappily, the politicians, unaccustomed to realities,
were not ready to make the most of this spirit of sacrifice. Unable to
leave their grooves of finesse, intrigue, and opportunism, they knew
not how to appeal simply to the noblest instincts; so they talked of
“business as usual,” and attempted to cajole the nation into giving a
part when the whole was ready to be offered.
This is the story of the part played in the most Composition of
appalling of human tragedies by the East
Lancashire Territorial Division, which, on leaving the Division
England, was composed of the following units—