100% found this document useful (6 votes)
66 views

Download full Spring 6 Recipes: A Problem-Solution Approach to Spring Framework 5th Edition Marten Deinum ebook all chapters

The document provides information about the ebook 'Spring 6 Recipes: A Problem-Solution Approach to Spring Framework, Fifth Edition' by Marten Deinum, Daniel Rubio, and Josh Long, available for download on ebookmeta.com. It includes links to additional recommended digital products related to Spring Framework and other topics. The document also contains details about the authors, copyright information, and a table of contents outlining various chapters and topics covered in the book.

Uploaded by

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

Download full Spring 6 Recipes: A Problem-Solution Approach to Spring Framework 5th Edition Marten Deinum ebook all chapters

The document provides information about the ebook 'Spring 6 Recipes: A Problem-Solution Approach to Spring Framework, Fifth Edition' by Marten Deinum, Daniel Rubio, and Josh Long, available for download on ebookmeta.com. It includes links to additional recommended digital products related to Spring Framework and other topics. The document also contains details about the authors, copyright information, and a table of contents outlining various chapters and topics covered in the book.

Uploaded by

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

Get the full ebook with Bonus Features for a Better Reading Experience on ebookmeta.

com

Spring 6 Recipes: A Problem-Solution Approach to


Spring Framework 5th Edition Marten Deinum

https://ebookmeta.com/product/spring-6-recipes-a-problem-
solution-approach-to-spring-framework-5th-edition-marten-
deinum/

OR CLICK HERE

DOWLOAD NOW

Download more ebook instantly today at https://ebookmeta.com


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

Spring Boot 2 Recipes: A Problem-Solution Approach 1st


Edition Marten Deinum

https://ebookmeta.com/product/spring-boot-2-recipes-a-problem-
solution-approach-1st-edition-marten-deinum/

ebookmeta.com

Pro Spring 6: An In-Depth Guide to the Spring Framework,


6th Edition Iuliana Cosmina

https://ebookmeta.com/product/pro-spring-6-an-in-depth-guide-to-the-
spring-framework-6th-edition-iuliana-cosmina/

ebookmeta.com

Introducing Spring Framework 6 2nd Edition Felipe


Gutierrez

https://ebookmeta.com/product/introducing-spring-framework-6-2nd-
edition-felipe-gutierrez/

ebookmeta.com

Multimodal Literacies Across Digital Learning Contexts 1st


Edition Maria Grazia Sindoni (Editor)

https://ebookmeta.com/product/multimodal-literacies-across-digital-
learning-contexts-1st-edition-maria-grazia-sindoni-editor/

ebookmeta.com
Indian Economy - Principles, Policies, and Progress | For
UPSC & State Civil Services Examinations Sri Ram Srirangam

https://ebookmeta.com/product/indian-economy-principles-policies-and-
progress-for-upsc-state-civil-services-examinations-sri-ram-srirangam/

ebookmeta.com

Dragons Vs Dinos Ann Bryant

https://ebookmeta.com/product/dragons-vs-dinos-ann-bryant/

ebookmeta.com

Business Cases in Organisation Behaviour and HRM


Perspectives from India 1st Edition Gopal P. Mahapatra

https://ebookmeta.com/product/business-cases-in-organisation-
behaviour-and-hrm-perspectives-from-india-1st-edition-gopal-p-
mahapatra/
ebookmeta.com

London s Underground 2nd Edition Oliver Green

https://ebookmeta.com/product/london-s-underground-2nd-edition-oliver-
green/

ebookmeta.com

The Paradigm Case The Cinema of Hitchcock and the


Contemporary Visual Arts Cultural Interactions Studies in
the Relationship between the Arts Bernard Mccarron
https://ebookmeta.com/product/the-paradigm-case-the-cinema-of-
hitchcock-and-the-contemporary-visual-arts-cultural-interactions-
studies-in-the-relationship-between-the-arts-bernard-mccarron/
ebookmeta.com
Tell No Lies Lucy Falls 3 1st Edition E R Whyte

https://ebookmeta.com/product/tell-no-lies-lucy-falls-3-1st-edition-e-
r-whyte/

ebookmeta.com
Spring 6 Recipes
A Problem-Solution Approach to Spring
Framework

Fifth Edition

Marten Deinum
Daniel Rubio
Josh Long
Spring 6 Recipes
A Problem-Solution Approach to
Spring Framework

Fifth Edition

Marten Deinum
Daniel Rubio
Josh Long
Spring 6 Recipes: A Problem-Solution Approach to Spring Framework
Marten Deinum Josh Long
Meppel, Drenthe, The Netherlands Canyon Country, CA, USA
Daniel Rubio
Ensenada, Baja California, Mexico

ISBN-13 (pbk): 978-1-4842-8648-7 ISBN-13 (electronic): 978-1-4842-8649-4


https://doi.org/10.1007/978-1-4842-8649-4

Copyright © 2023 by Marten Deinum, Daniel Rubio, Josh Long


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.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with
every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an
editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the
trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not
identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to
proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication,
neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or
omissions that may be made. The publisher makes no warranty, express or implied, with respect to the
material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Steve Anglin
Development Editor: Laura Berendson
Coordinating Editor: Mark Powers
Cover designed by eStudioCalamar
Cover image by Yoksel Zok on Unsplash (www.unsplash.com)
Distributed to the book trade worldwide by Apress Media, LLC, 1 New York Plaza, New York, NY 10004,
U.S.A. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-sbm.com, or visit
www.springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is Springer
Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
For information on translations, please e-mail booktranslations@springernature.com; for reprint,
paperback, or audio rights, please e-mail bookpermissions@springernature.com.
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and
licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales
web page at http://www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is available to
readers on GitHub (https://github.com/Apress). For more detailed information, please visit http://www.
apress.com/source-code.
Printed on acid-free paper
Table of Contents

About the Authors�������������������������������������������������������������������������������������������������xxiii


About the Technical Reviewer�������������������������������������������������������������������������������xxv
Acknowledgments�����������������������������������������������������������������������������������������������xxvii
Introduction����������������������������������������������������������������������������������������������������������xxix


■Chapter 1: Spring Core Tasks�������������������������������������������������������������������������������� 1
1-1. Using Java Config to Configure POJOs��������������������������������������������������������������������� 1
Problem�������������������������������������������������������������������������������������������������������������������������������������������������� 1
Solution�������������������������������������������������������������������������������������������������������������������������������������������������� 1
How It Works������������������������������������������������������������������������������������������������������������������������������������������� 2

1-2. Create POJOs by Invoking a Constructor������������������������������������������������������������������ 8


Problem�������������������������������������������������������������������������������������������������������������������������������������������������� 8
Solution�������������������������������������������������������������������������������������������������������������������������������������������������� 8
How It Works������������������������������������������������������������������������������������������������������������������������������������������� 9
1-3. Use POJO References and Autowiring to Interact with Other POJOs���������������������� 11
Problem������������������������������������������������������������������������������������������������������������������������������������������������ 11
Solution������������������������������������������������������������������������������������������������������������������������������������������������ 12
How It Works����������������������������������������������������������������������������������������������������������������������������������������� 12

1-4. Autowire POJOs with the @Resource and @Inject Annotations����������������������������� 19


Problem������������������������������������������������������������������������������������������������������������������������������������������������ 19
Solution������������������������������������������������������������������������������������������������������������������������������������������������ 19
How It Works����������������������������������������������������������������������������������������������������������������������������������������� 19

iii
■ Table of Contents

1-5. Set a POJO’s Scope with the @Scope Annotation�������������������������������������������������� 21


Problem������������������������������������������������������������������������������������������������������������������������������������������������ 21
Solution������������������������������������������������������������������������������������������������������������������������������������������������ 21
How It Works����������������������������������������������������������������������������������������������������������������������������������������� 22

1-6. Use Data from External Resources (Text Files, XML Files, Properties Files,
or Image Files)���������������������������������������������������������������������������������������������������������������� 24
Problem������������������������������������������������������������������������������������������������������������������������������������������������ 24
Solution������������������������������������������������������������������������������������������������������������������������������������������������ 25
How It Works����������������������������������������������������������������������������������������������������������������������������������������� 25

1-7. Resolve I18N Text Messages for Different Locales in Properties Files������������������� 29
Problem������������������������������������������������������������������������������������������������������������������������������������������������ 29
Solution������������������������������������������������������������������������������������������������������������������������������������������������ 30
How It Works����������������������������������������������������������������������������������������������������������������������������������������� 30

1-8. Customize POJO Initialization and Destruction with Annotations��������������������������� 32


Problem������������������������������������������������������������������������������������������������������������������������������������������������ 32
Solution������������������������������������������������������������������������������������������������������������������������������������������������ 32
How It Works����������������������������������������������������������������������������������������������������������������������������������������� 32

1-9. Create Post-processors to Validate and Modify POJOs������������������������������������������� 36


Problem������������������������������������������������������������������������������������������������������������������������������������������������ 36
Solution������������������������������������������������������������������������������������������������������������������������������������������������ 36
How It Works����������������������������������������������������������������������������������������������������������������������������������������� 36

1-10. Create POJOs with a Factory (Static Method, Instance Method, Spring’s
FactoryBean)������������������������������������������������������������������������������������������������������������������ 38
Problem������������������������������������������������������������������������������������������������������������������������������������������������ 38
Solution������������������������������������������������������������������������������������������������������������������������������������������������ 38
How It Works����������������������������������������������������������������������������������������������������������������������������������������� 38

1-11. Use Spring Environments and Profiles to Load Different Sets of POJOs�������������� 43
Problem������������������������������������������������������������������������������������������������������������������������������������������������ 43
Solution������������������������������������������������������������������������������������������������������������������������������������������������ 43
How It Works����������������������������������������������������������������������������������������������������������������������������������������� 43

iv
■ Table of Contents

1-12. Making POJOs Aware of Spring’s IoC Container Resources��������������������������������� 46


Problem������������������������������������������������������������������������������������������������������������������������������������������������ 46
Solution������������������������������������������������������������������������������������������������������������������������������������������������ 46
How It Works����������������������������������������������������������������������������������������������������������������������������������������� 48

1-13. Aspect-Oriented Programming with Annotations�������������������������������������������������� 48


Problem������������������������������������������������������������������������������������������������������������������������������������������������ 48
Solution������������������������������������������������������������������������������������������������������������������������������������������������ 49
How It Works����������������������������������������������������������������������������������������������������������������������������������������� 49

1-14. Accessing the Join Point Information������������������������������������������������������������������� 58


Problem������������������������������������������������������������������������������������������������������������������������������������������������ 58
Solution������������������������������������������������������������������������������������������������������������������������������������������������ 58
How It Works����������������������������������������������������������������������������������������������������������������������������������������� 58

1-15. Specifying Aspect Precedence with the @Order Annotation������������������������������� 59


Problem������������������������������������������������������������������������������������������������������������������������������������������������ 59
Solution������������������������������������������������������������������������������������������������������������������������������������������������ 59
How It Works����������������������������������������������������������������������������������������������������������������������������������������� 60

1-16. Reuse Aspect Pointcut Definitions������������������������������������������������������������������������ 61


Problem������������������������������������������������������������������������������������������������������������������������������������������������ 61
Solution������������������������������������������������������������������������������������������������������������������������������������������������ 61
How It Works����������������������������������������������������������������������������������������������������������������������������������������� 61

1-17. Writing AspectJ Pointcut Expressions������������������������������������������������������������������� 63


Problem������������������������������������������������������������������������������������������������������������������������������������������������ 63
Solution������������������������������������������������������������������������������������������������������������������������������������������������ 63
How It Works����������������������������������������������������������������������������������������������������������������������������������������� 63

1-18. AOP Introductions for POJOs��������������������������������������������������������������������������������� 68


Problem������������������������������������������������������������������������������������������������������������������������������������������������ 68
Solution������������������������������������������������������������������������������������������������������������������������������������������������ 68
How It Works����������������������������������������������������������������������������������������������������������������������������������������� 68

v
■ Table of Contents

1-19. Introduce States to Your POJOs with AOP������������������������������������������������������������� 71


Problem������������������������������������������������������������������������������������������������������������������������������������������������ 71
Solution������������������������������������������������������������������������������������������������������������������������������������������������ 71
How It Works����������������������������������������������������������������������������������������������������������������������������������������� 71

1-20. Load-Time Weaving AspectJ Aspects in Spring���������������������������������������������������� 73


Problem������������������������������������������������������������������������������������������������������������������������������������������������ 73
Solution������������������������������������������������������������������������������������������������������������������������������������������������ 74
How It Works����������������������������������������������������������������������������������������������������������������������������������������� 74

1-21. Configuring Aspects in Spring������������������������������������������������������������������������������ 78


Problem������������������������������������������������������������������������������������������������������������������������������������������������ 78
Solution������������������������������������������������������������������������������������������������������������������������������������������������ 79
How It Works����������������������������������������������������������������������������������������������������������������������������������������� 79

1-22. Inject POJOs into Domain Objects with AOP��������������������������������������������������������� 80


Problem������������������������������������������������������������������������������������������������������������������������������������������������ 80
Solution������������������������������������������������������������������������������������������������������������������������������������������������ 80
How It Works����������������������������������������������������������������������������������������������������������������������������������������� 80

1-23. Concurrency with Spring and TaskExecutors�������������������������������������������������������� 82


Problem������������������������������������������������������������������������������������������������������������������������������������������������ 82
Solution������������������������������������������������������������������������������������������������������������������������������������������������ 83
How It Works����������������������������������������������������������������������������������������������������������������������������������������� 83

1-24. Communicate Application Events Between POJOs����������������������������������������������� 89


Problem������������������������������������������������������������������������������������������������������������������������������������������������ 89
Solution������������������������������������������������������������������������������������������������������������������������������������������������ 90
How It Works����������������������������������������������������������������������������������������������������������������������������������������� 90

1-25. Create and Register Beans in a Functional Way��������������������������������������������������� 93


Problem������������������������������������������������������������������������������������������������������������������������������������������������ 93
Solution������������������������������������������������������������������������������������������������������������������������������������������������ 93
How It Works����������������������������������������������������������������������������������������������������������������������������������������� 93

1-26. Summary�������������������������������������������������������������������������������������������������������������� 96

vi
■ Table of Contents


■Chapter 2: Spring MVC���������������������������������������������������������������������������������������� 99
2-1. Developing a Simple Web Application with Spring MVC��������������������������������������� 100
Problem���������������������������������������������������������������������������������������������������������������������������������������������� 100
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 100
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 102

2-2. Mapping Requests with @RequestMapping��������������������������������������������������������� 114


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 114
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 114
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 114

2-3. Intercepting Requests with Handler Interceptors������������������������������������������������� 118


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 118
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 118
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 119

2-4. Resolving User Locales����������������������������������������������������������������������������������������� 121


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 121
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 121
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 122

2-5. Externalizing Locale-Sensitive Text Messages����������������������������������������������������� 124


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 124
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 124
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 124

2-6. Resolving Views by Names����������������������������������������������������������������������������������� 126


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 126
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 126
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 126

2-7. Views and Content Negotiation����������������������������������������������������������������������������� 128


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 128
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 128
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 129

vii
■ Table of Contents

2-8. Mapping Exceptions to Views������������������������������������������������������������������������������� 131


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 131
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 131
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 131

2-9. Handling Forms with Controllers�������������������������������������������������������������������������� 134


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 134
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 135
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 135
2-10. Bean Validation with Annotations (Jakarta Bean Validation API)������������������������� 149
Problem���������������������������������������������������������������������������������������������������������������������������������������������� 149
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 150
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 150

2-11. Creating Excel and PDF Views���������������������������������������������������������������������������� 152


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 152
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 152
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 152

2-12. Asynchronous Request Handling with Controllers���������������������������������������������� 160


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 160
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 160
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 160

2-13. Summary������������������������������������������������������������������������������������������������������������ 163



■Chapter 3: Spring MVC: REST Services�������������������������������������������������������������� 165
3-1. Publishing XML with REST Services��������������������������������������������������������������������� 165
Problem���������������������������������������������������������������������������������������������������������������������������������������������� 165
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 165
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 166

3-2. Publishing JSON with REST Services������������������������������������������������������������������� 173


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 173
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 173
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 174

viii
■ Table of Contents

3-3. Receiving Payloads with a REST Controller���������������������������������������������������������� 178


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 178
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 179
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 179

3-4. Accessing a REST Service with Spring����������������������������������������������������������������� 184


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 184
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 184
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 184
3-5. Publishing RSS and Atom Feeds��������������������������������������������������������������������������� 188
Problem���������������������������������������������������������������������������������������������������������������������������������������������� 188
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 189
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 189

3-6. Response Writers�������������������������������������������������������������������������������������������������� 198


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 198
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 198
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 198

3-7. Summary�������������������������������������������������������������������������������������������������������������� 203



■Chapter 4: Spring WebFlux�������������������������������������������������������������������������������� 205
4-1. Developing a Reactive Application with Spring WebFlux�������������������������������������� 205
Problem���������������������������������������������������������������������������������������������������������������������������������������������� 205
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 205
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 206

4-2. Publishing and Consuming JSON with Reactive REST Services��������������������������� 211
Problem���������������������������������������������������������������������������������������������������������������������������������������������� 211
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 212
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 212

4-3. Exception Handling with Reactive Controllers������������������������������������������������������ 216


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 216
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 216
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 216

ix
■ Table of Contents

4-4. Handling Forms with Reactive Controllers������������������������������������������������������������ 221


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 221
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 222
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 222

4-5. Asynchronous Web Client������������������������������������������������������������������������������������� 233


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 233
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 233
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 233
4-6. Writing Reactive Handler Functions���������������������������������������������������������������������� 237
Problem���������������������������������������������������������������������������������������������������������������������������������������������� 237
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 237
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 237

4-7. Summary�������������������������������������������������������������������������������������������������������������� 240



■Chapter 5: Spring Security�������������������������������������������������������������������������������� 241
5-1. Securing URL Access�������������������������������������������������������������������������������������������� 242
Problem���������������������������������������������������������������������������������������������������������������������������������������������� 242
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 242
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 243

5-2. Logging Into Web Applications������������������������������������������������������������������������������ 248


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 248
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 248
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 248

5-3. Authenticating Users��������������������������������������������������������������������������������������������� 256


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 256
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 256
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 257

5-4. Making Access Control Decisions������������������������������������������������������������������������� 264


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 264
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 264
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 265

x
■ Table of Contents

5-5. Securing Method Invocations������������������������������������������������������������������������������� 268


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 268
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 268
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 268

5-6. Handling Security in Views����������������������������������������������������������������������������������� 272


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 272
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 272
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 272
5-7. Handling Domain Object Security������������������������������������������������������������������������� 274
Problem���������������������������������������������������������������������������������������������������������������������������������������������� 274
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 274
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 274

5-8. Adding Security to a WebFlux Application������������������������������������������������������������� 281


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 281
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 281
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 281

5-9. Summary�������������������������������������������������������������������������������������������������������������� 289



■Chapter 6: Data Access������������������������������������������������������������������������������������� 291
6-1. Problems with Direct JDBC����������������������������������������������������������������������������������� 292
6-2. Setting Up the Application Database�������������������������������������������������������������������� 292
Understanding the Data Access Object Design Pattern���������������������������������������������������������������������� 293
Implementing the DAO with JDBC������������������������������������������������������������������������������������������������������ 294
Configuring a DataSource in Spring��������������������������������������������������������������������������������������������������� 296
Running the DAO�������������������������������������������������������������������������������������������������������������������������������� 298

Taking It a Step Further������������������������������������������������������������������������������������������������ 298


6-3. Using a JDBC Template to Work with a Database������������������������������������������������� 299
Problem���������������������������������������������������������������������������������������������������������������������������������������������� 299
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 299
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 299
Batch Updating a Database���������������������������������������������������������������������������������������������������������������� 303

xi
■ Table of Contents

6-4. Using a JDBC Template to Query a Database������������������������������������������������������� 304


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 304
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 305
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 305

6-5. Simplifying JDBC Template Creation��������������������������������������������������������������������� 311


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 311
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 311
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 311

6-6. Using Named Parameters in a JDBC Template����������������������������������������������������� 314


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 314
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 314
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 314

6-7. Handling Exceptions in the Spring JDBC Framework������������������������������������������� 316


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 316
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 316
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 317

6-8. Problems with Using ORM Frameworks Directly�������������������������������������������������� 321


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 321
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 322
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 322

6-9. Configuring ORM Resource Factories in Spring���������������������������������������������������� 330


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 330
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 330
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 330

6-10. Persisting Objects with Hibernate’s Contextual Sessions����������������������������������� 337


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 337
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 337
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 337

xii
■ Table of Contents

6-11. Persisting Objects with JPA’s Context Injection�������������������������������������������������� 340


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 340
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 340
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 341

6-12. Simplify JPA with Spring Data JPA��������������������������������������������������������������������� 345


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 345
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 345
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 345
6-13. Reactive Database Access with R2DBC�������������������������������������������������������������� 346
Problem with Plain R2DBC����������������������������������������������������������������������������������������������������������������� 346
Problem���������������������������������������������������������������������������������������������������������������������������������������������� 352
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 352
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 352

6-14. Summary������������������������������������������������������������������������������������������������������������ 360



■Chapter 7: Spring Transaction Management����������������������������������������������������� 361
7-1. Problems with Transaction Management�������������������������������������������������������������� 362
Managing Transactions with JDBC Commit and Rollback������������������������������������������������������������������ 367

7-2. Choosing a Transaction Manager Implementation������������������������������������������������ 368


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 368
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 369
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 369

7-3. Managing Transactions Programmatically with the Transaction Manager API����� 370
Problem���������������������������������������������������������������������������������������������������������������������������������������������� 370
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 370
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 371

7-4. Managing Transactions Programmatically with a Transaction Template�������������� 374


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 374
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 374
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 375

xiii
■ Table of Contents

7-5. Managing Transactions Declaratively with the @Transactional Annotation��������� 380


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 380
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 381
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 381

7-6. Setting the Propagation Transaction Attribute������������������������������������������������������ 382


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 382
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 383
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 383
7-7. Setting the Isolation Transaction Attribute������������������������������������������������������������ 388
Problem���������������������������������������������������������������������������������������������������������������������������������������������� 388
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 388
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 389

7-8. Setting the Rollback Transaction Attribute������������������������������������������������������������ 396


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 396
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 396
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 396

7-9. Setting the Timeout and Read-Only Transaction Attributes���������������������������������� 397


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 397
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 397
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 397

7-10. Managing Transactions with Load-Time Weaving����������������������������������������������� 398


Problem���������������������������������������������������������������������������������������������������������������������������������������������� 398
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 398
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 398

7-11. Summary������������������������������������������������������������������������������������������������������������ 399



■Chapter 8: Spring Batch������������������������������������������������������������������������������������ 401
8-1. Runtime Metadata Model�������������������������������������������������������������������������������������� 402
8-2. Setting Up Spring Batch’s Infrastructure�������������������������������������������������������������� 403
Problem���������������������������������������������������������������������������������������������������������������������������������������������� 403
Solution���������������������������������������������������������������������������������������������������������������������������������������������� 403
How It Works��������������������������������������������������������������������������������������������������������������������������������������� 403
xiv
Other documents randomly have
different content
oils or with the ichthyol-mercurial ointment. It has been successfully
treated, as is keloid, by the subcutaneous use of a 10 per cent.
alcoholic solution of thiosinamin. The ultraviolet rays and even the x-
rays, used judiciously and carefully, may also be of service.
Rhinophyma.—This form of tumor is to be differentiated from
rhinoscleroma, the latter being due to a peculiar specific bacillus,
while rhinophyma is a filth disease, due to hypertrophy of the
sebaceous structures of the nose from obstruction of the sebaceous
ducts. It is often seen among alcoholics, perhaps less frequently at
home than abroad. Pathologically it consists of enormous and
irregular hypertrophy of the sebaceous gland elements and
connective tissue of the skin of the nose. Each hypertrophied gland
secretes in proportion to its increase in size, and even the vessels of
the part become engorged. In consequence there results a
lobulated, distorted, most disagreeable appearance, which often
becomes exceedingly offensive. The tumors thus formed sometimes
increase to a size sufficient to interfere with breathing and with
feeding. The resulting nasal enlargement is usually trilobed. The first
impetus to the overgrowth comes sometimes from such cutaneous
irritation as frostbite, or local irritation of some kind.
Treatment.—The treatment of rhinophyma consists in the
unrestricted use of scissors and the sharp spoon, with the
preservation of so much of the integumentary structure as may
serve to cover the reduced dimension of the nose. These lesions will
bleed freely at first, but bleeding is usually easily checked. When a
plastic covering of the defect is impossible, the surface may be left
to granulate, with a certain feeling of security that the cicatricial
contraction following will reduce the enlargement to normal
proportions.
Xanthoma.—This name is applied to a macular lesion, papillary
or tuberculous, marked by the appearance of yellowish spots,
occurring singly or in groups, often about the eyelids, but seen
anywhere upon the skin. When occurring in papules it is called
xanthoma planum; when in nodules, xanthoma tuberosum. There is
a variety met with in diabetes which is temporary and usually
disappears spontaneously.
Treatment.—The treatment for xanthomatous patches is either
electrolysis or complete excision, under local anesthesia.
Keratosis.—Keratosis is a term applied to thickening of the
normal epidermis, occurring in limited areas, the skin being
transformed into tense or almost horny tissue. The form which
occurs in elderly individuals is called keratosis senilis. It occurs upon
the face, the hands, and forearms, but may be seen on any part of
the body. The involved areas become discolored, sometimes by true
pigmentation, more often by a deposit of dirt. As long as epithelial
reproduction occurs away from the basement membrane the lesions
are simple and innocent, but in elderly people it requires but little
irritation to provoke a down-growth of epithelium, and then the
development of epithelioma is rapid.
Treatment.—These reduplicated epithelial elements can be kept
soft by an application of equal parts of glycerin and liquor potassæ.
After being softened they may be easily scraped down to a normal
level, but will later reform. If they begin to ulcerate they should be
excised. Should excision be declined the area may be treated with
the thermocautery or with one of the caustic pastes.
Vascular Growths.—These have already been mentioned in the
chapter on Tumors, under the head of Angioma. So far as the skin is
concerned they usually occur in the shape of nevi (called strawberry
growths) or the more disseminated form, sometimes involving
considerable areas, commonly known as “port-wine marks,” which
are essentially cutaneous telangiectases, are almost always of
congenital origin, and frequently appear in complete form even at
birth. They may occur rapidly or slowly. An isolated nevus should be
treated by complete excision. Large vascular areas, or port-wine
marks, are best treated by repeated electrolysis. If treated early they
are sometimes eradicated by the local use of sodium ethylate.
The so-called nevus pigmentosus, or pigmented mole, is generally
of congenital origin, and may or may not be accompanied by
vascular changes. It is not infrequently covered with hair, and
sometimes forms a patch of considerable size, often upon the face.
These lesions occasionally occur in such form as to entitle them to
be styled nevus verrucosus or nevus pilosus. Occurring upon the
back or trunk they are usually disregarded. When upon the face they
should receive surgical treatment.
Treatment.—Excision is, of course, the best method of treatment
unless a disfiguring scar be feared. This can usually be prevented by
proper plastic methods. When excision seems inadvisable electrolysis
is the next best method of attack. No matter how vascular may be
the lesion itself, the vessels a short distance from the margin of
these growths are rarely dilated, and hemorrhage is not a feature
which need deter one from radical treatment.
Lymphangioma.—This has also been described in the chapter on
Tumors. A circumscribed form is occasionally found in or beneath the
skin. It occurs early in life, constitutes a more or less sessile tumor,
which collapses on pressure, fills slowly, its surface being often
irregular, warty, or horny. Should the surface be injured lymph will
escape rather than blood. An extended form of it constitutes one
kind of elephantiasis. (See chapter on Lymphatics.) Any septic
infection of a growth of this character is likely to result seriously and
at once.
Treatment.—The best treatment is excision under thorough aseptic
precautions; next to this is destruction with the cautery, which will
lead to resulting sloughing and cicatrization.
Malignant Disease.—All forms of cancer may appear, primarily,
in or upon the skin. From the ordinary surface epithelium springs
epithelioma; from the glandular elements possibly round-cell
carcinoma; and from the mesodermic elements any of the radical
varieties of sarcoma, while endothelioma is less common.
Epithelioma.—This is a frequent infection of the skin, which may
arise primarily as an original lesion, usually following surface
irritation, or secondarily, either as the extension of similar disease
from other parts or of degeneration of previously innocent epithelial
tumors. Epithelial outgrowth, so long as it be an outgrowth, and do
not transgress the limits of the basement membrane, is essentially
innocent in character; but so soon as growth in the downward
direction begins we have the beginning of a skin cancer, which may
proceed to fatal extent if not promptly recognized and properly
treated. These growths vary very much in rapidity and malignancy.
Occurring upon surfaces which are kept constantly moist and warm
they develop more rapidly, as upon the tongue, within the vulva,
rectum, etc. The slowest form of growth of this kind is the so-called
rodent ulcer. Epithelioma which begins in or upon the skin or mucous
membrane tends to spread to and involve everything in its
neighborhood; even bone and cartilage succumb to its ravages, and,
becoming involved, lose all their characteristics and melt away in the
surrounding ulcer. This produces in the course of time hideous and
serious developments. No tissue is exempt from its ravages, and yet
life may be prolonged for many years, even when the face is almost
entirely eaten away. Epithelioma and rodent ulcer have been
described in the chapter on Tumors.
More deeply seated Fig. 108
carcinomas of the
skin infiltrate in both
directions alike, and
grow downward,
sometimes in cylinder
form, thus giving rise
to a clinical type
called cylindroma.
Lenticular carcinoma
is also described as
differing from the
ordinary epithelioma,
in that it exhibits a
true alveolar
structure. This form is
rare, and is Epithelioma.
distinguished from
the common form by the absence of the so-called “pearly bodies,”
which characterize common epithelioma. The lenticular form is most
often seen in recurring cancer of the breast, or in the vicinity of
scars showing where deep-seated cancer had existed.
Diagnosis.—Epithelioma in its various forms should be
distinguished from skin lesions due to syphilis and tuberculosis. A
diagnostic table has been given (see p. 293) by which diagnosis as
between it and lupus may ordinarily be made. The lesions of syphilis
are usually multiple and accompanied by other manifestations which
stamp their character. There is, moreover, usually a history which will
be suggestive if not actually helpful. In cases of actual doubt, as
upon the tongue and elsewhere, the therapeutic test may be
applied. If resorted to, it should be vigorously made. When mercurial
inunction is thoroughly practised, and the internal administration of
the iodides effects no improvement within three weeks, the
hypothesis of syphilis may be abandoned.
All cancerous lesions tend to advance and to destroy in spite of all
local measures. There never appears about them any indication of a
tendency toward cicatrization, and, while the edges of malignant
ulcers may be thickened and everted, the more central portions are
always excavated. They cause, moreover, involvement of the
adjoining lymphatics, although this may be said as well of syphilitic
and tuberculous lesions.
Treatment.—Concerning the treatment of epithelioma and other
malignant skin diseases there is little to be said which has not
already been summarized in the general considerations concerning
the treatment of cancer. Radical excision of the original lesion, in its
early stages, will usually lead to final recovery. If there be
involvement of the lymphatics the indication is made thereby more
positive for cleaning out all infected areas, while, at the same time,
the prognosis is rendered less favorable. There comes a time in the
history of all these cases when excision can be recommended only
as a palliative measure, i. e., when it may be regarded as useless. In
the more hopeless cases benefit will but rarely be obtained from the
use of x-rays, ultraviolet light, or radium.
Paget’s Disease.—Paget’s disease includes lesions now regarded
as a precancerous stage, which appear upon the breasts and around
the nipples of women during the middle decades of life. Something
similar is seen in other parts of the body and in both sexes, but it is
most common around the nipple on one side. For a long time it
appears as an ordinary eczema, which, however, does not tend to
heal but to spread, while the skin beneath becomes more or less
infiltrated. A gradual retrocession of the nipple is usually seen.
Certain discomfort accompanies the lesion, which may go on
indefinitely until it becomes unmistakably cancerous. This is a
precursor not so much of round-cell cancer (scirrhus) as of
epithelioma. Eczema of the nipple is to be regarded with suspicion,
especially when occurring after the menopause. Until diagnosis is
fairly established it is best treated with soothing applications. So
soon as the cancerous stage has been determined the breast should
be removed. (See Plate XXVI.)
Other forms of malignant or border-land tumors which occur upon
the skin are chimney-sweeper’s cancer, paraffin cancer, and that
met with in aniline workers. Chimney-sweeper’s cancer was the
name applied to epithelioma of the scrotum occurring among a class
of laborers whose occupation is now almost entirely extinct. It began
usually as papilloma and merged into epithelioma. Among workers in
paraffin and coal-tar factories there is an analogous lesion, the result
of surface irritation, the skin becoming dry, thickened, covered with
acne-like pustules, and then with papillomas which ulcerate and
frequently change over into true epitheliomas.
Sarcoma.—Only the outer layers of the skin are truly epiblastic.
In the depths of the integument mesoblastic elements enter largely,
and from these various forms of sarcoma may develop. These have
already been treated in the chapter on Tumors. They may be single
or multiple, and a general disseminated sarcomatosis is occasionally
observed. It corresponds to miliary tuberculosis, but presents many
distinctive lesions in the skin, by which it may be easily recognized.
A form of multiple pigmented sarcoma involving the hands is
represented in Fig. 109. These growths are almost always tender on
pressure and more or less painful. They coalesce and finally form
fatal lesions.
Melanoma.—This term was introduced by Virchow, who made it
cover all pigmented growths. By common consent it is today limited
to tumors of the skin and uveal tract which contain pigment;
metastases may occur in any or all of them. They occur as malignant
degenerations of nevi, moles, and other small growths. Pathologists
are still disputing as to whether they should be considered sarcomas
or endotheliomas. The coloring matter which they contain is
amorphous, finely granular material, lying between the cells in
moles, but occurring free in the tissues and blood and even in the
urine. It is soluble in strong alkalies, from which it can be recovered
as melanic acid, containing a small proportion of sulphur. Of its
origin nothing is positively known. It seems to be generally accepted
that the deposit of pigment is not of itself a causative agent of the
growth of the tumor, but that the growth of cells and their
pigmentation are coincident processes. Johnston has offered much
evidence lately to the effect that growths from nevi are really of
endothelial origin. Hutchinson has described melanotic whitlow. (See
below, the Nails.)
Melanoma is a pigmented ulcerating neoplasm, which possesses at
first only a local malignancy like that of rodent ulcer; the more it
assumes the endotheliomatous type of growth the more it tends to
disseminate and to prove fatal.
The melanoma arising from a mole or nevus, thus known as
melano-endothelioma, begins to increase in size and becomes more
full, as well as to assume a darker tint. For a variable time it is a
single, rather firm, gradually growing, flat tumor, rarely ulcerating,
but sometimes exuding a thin dark fluid. Suddenly there appears
rapid local spread as well as dissemination. The latter may be first
noted in the adjoining lymph nodes. Thus numerous secondary
tumors may be felt in and beneath the skin, at first colorless,
becoming more or less rapidly pigmented. Metastasis may take place
to every organ in the body, but usually the liver and lungs—less
often the brain—are involved. In one case known to the writer the
heart was a mass of nodules of this same secondary character.
Another expression of the same serious condition is seen in a
lesion called by the French malignant lentigo, which also begins with
pigmented spots, on the feet of old men, sometimes upon the face.
These lesions cause thickening of the skin and early ulceration.
Rodent ulcer, which is one form of epithelioma, occasionally
assumes the melanotic type, and is called melano-epithelioma.
Fig. 109
Fibrosarcoma of hands. (Hardaway.)

The most marked collection of pigment in the human body, within


small space, is along the uveal tract within the eye, and orbital
melanomas are not infrequent. Beginning within the sclerotic they
rapidly perforate this dense membrane and spread to adjoining
tissues, while dissemination and metastasis occur early and rapidly.
Treatment.—For melanoma there is but one successful treatment,
and this is successful only when practised early, i. e., complete
excision or destruction. Every mole, nevus, or other skin lesion which
shows the slightest tendency to changes noted above should be
promptly excised, along with a wide area of its surrounding tissue. It
may be thus possible to make a radical cure. Neither x-rays nor any
other less radical method of treatment will have the slightest effect.
The treatment of any case left to itself until mistake in diagnosis is
impossible will probably be of little avail.

SKIN APPENDAGES; HAIR AND NAILS.


The only lesions of the hair and hair follicles that concern the
surgeon are those which have been described under the head of
Syphilis of the Skin, or some of the congenital growths, such as
plexiform neuroma, lymphangioma, etc., whose surfaces are
frequently pigmented and hairy, and may call for excision, along with
the underlying tumor.
The Nails.—Onychia implies any disturbance of the nail border
and matrix. Simple onychia occurs frequently in the fingers of
marasmic children. It is evidenced by softening and swelling of the
skin around the nail, by more or less pain, disturbance of circulation
beneath the nail, which becomes finally loosened, sometimes leaving
a foul ulcer. This ulceration may extend and involve nearly the whole
finger. It may occur in one or in several fingers. Lesions of this kind
are regarded as local infections, occurring usually in vitiated
constitutions. It is a common expression or complication of syphilis;
when of such origin it yields readily to treatment; at other times it is
often slow and tedious. Except in specific cases, where mercurials
locally and internally will usually be sufficient, the treatment should
be radical and should consist of thorough exposure of the ulcerating
and fungous surfaces, thorough curetting, and the use of suitable
caustics and antiseptic dressings.
Onychia Maligna.—Onychia maligna implies, according to some
writers, a more distinctive type of phlegmonous lesion, while the
term has also been applied to malignant ulcers, sometimes
pigmented (see Melanoma above) and sometimes of more ordinary
type. In either type of lesion granulation tissue may be exuberant
and fungating, and it is possible that at times there will be doubt in
diagnosis. The finger-tips, with their peculiar tactile sensibility,
should never be sacrificed unnecessarily, yet any malignant lesion
calls for amputation of the finger.
Ingrowing Toenail.—This is due almost invariably to ill-fitting
footwear, the toes being crowded into too narrow shoes, with too
high heels. The real lesion is not so much an excessive growth of the
nail as overgrowth and overriding of the skin margin around the
matrix. It is painful and annoying, sometimes even disabling. The
maceration of a perspiring foot in a warm and tight shoe serves to
aggravate the difficulty. Palliative treatment is afforded by
chiropodists and quacks, who pack cotton beneath the edge of the
nail and keep patients under treatment for indefinite periods, never
remedying the footwear and never curing the case. In simple cases
it is usually sufficient to excise a portion of reasonably healthy skin
on either side of the terminal phalanx, in order that by cicatricial
contraction the skin may be drawn away from the nail border.
Serious and long-standing cases are best treated by avulsion of the
nail, which may be usually performed under local anesthesia or by
the aid of nitrous oxide gas. The blade of a knife or scissors is driven
under the centre of the nail sufficiently to ensure its passing
completely beneath the hidden matrix. The nail is then split in the
middle, each half seized at its split border by strong forceps, and by
a rapid movement torn loose from its bed. The border of the skin
should be scraped, after which a simple dressing suffices, providing
the operation has been performed with proper antiseptic
precautions.
TATTOO MARKS.
Many an individual is tattooed in youth who would gladly be
relieved of the discoloration later in life. Tattoo marks are difficult to
erase. The following is a method attributed to Ohmann-Dumesnil:
“Wash the skin with soap and water, then with eight or ten fine
cambric needles, tied together and dipped in glycerole of papoid,
tattoo the stained skin, driving the needles into the tissues so as to
deposit the digestive in the corium, where the carbon is located.
Repeat as necessary. The pigment is liberated by the digestant.”
CHAPTER XXVIII.
SURGICAL DISEASES OF THE FASCIÆ;
APONEUROSES; TENDONS AND TENDON SHEATHS;
MUSCLES AND BURSÆ.
Fasciæ and aponeuroses are such non-vascular and indifferent
tissues that they have practically no primary diseases, except such
fibrous and malignant tumors as have their origin in them;
nevertheless they suffer in a variety of morbid processes. They lose
vitality and break down under the influence of both acute and
chronic septic infections. By virtue of their resistant structure, when
they slough they break down slowly and the process ends usually
with the help of scissors and forceps. Many an old suppurating
lesion, especially of the hand and foot, is kept active by the fact that
dense, fibrous tissue remains concealed, which ought to have
separated. Under these circumstances free incisions should be made
and all necrotic tissue trimmed away.
Pus which has formed beneath these fibrous investments will give
pain largely in proportion to the intensity of the process and the
unyielding character of the fasciæ; hence the urgency of early
incision in case of deep phlegmon. Moreover, the direction of least
resistance may cause pus when confined to travel where its
presence is most undesirable, as from the neck beneath the deeper
muscle planes down into the thorax. When pus escapes from
beneath firm tissue it is usually by a small opening, after which it
may spread out again beneath the skin before finally escaping. This
condition has been called “collar-button abscess.” Care should be
exercised in opening the superficial collection not to miss the small
opening. The fascia must be split sufficiently to permit of thorough
cleaning out of whatever collection there may be beneath it.
In the presence of cicatricial contraction of the skin, in shortening
of muscles by chronic spasm, as in wryneck, or in certain deformities
—for instance of the foot—numerous signs of a shortening or
contraction of fasciæ and aponeuroses are seen. In many instances
of club-foot it thus becomes necessary not merely to divide tendons
but to make extensive incisions through the plantar aponeurosis or
elsewhere, in order to release sufficiently the parts whose extension
is desired. Underneath the joint contractures which have been
produced by burns and their resulting scars similar conditions will be
found, which in old and extensive cases constitute bridles of dense
tissue that make it almost impossible to release the parts.

DUPUYTREN’S CONTRACTION.
Dupuytren’s contraction presents the most serious and insidious
appearance of slow but almost irresistible contraction of fibrous
elements which the human body presents. It is produced by
contraction of the palmar fascia, with its numerous minute
prolongations, rather than by flexor tendons. It is seen in the hands
of men who from the nature of their occupations are subject to
much irritation of the palmar surface. It begins nearly always in the
fourth or fifth fingers, but may spread to and involve all the digits
and even the thumb. The view held by Adams and others that it is a
chronic hyperplastic inflammation, with scar-tissue contraction of the
palmar fascia and of the adjoining connective and fatty tissue, which
does not involve them evenly, but only at certain points, is correct,
at least when small nodules may be felt in the palm which are the
precursors of the disease. Either hand may be affected, but
generally both are involved. It is found in from 1 to 2 per cent. of
those who depend upon their hands for their support. Deformity
may proceed to pressure dislocation and finally to ankylosis. Its
causation then is very obscure; it is rarely the result of definite
injury, but follows continued irritation of the surface. It seems to
have a local origin, and yet it is frequently associated with the gouty
diathesis to such an extent that the prolonged use of alkalies will
relieve some cases. The first significant sign of the condition is the
formation of small nodules in the palm of the hand, as stated, and
this usually precedes the finger contraction by a year or two.
Fig. 110 Fig. 111

Dupuytren’s contraction. (Adams.) Dupuytren’s contraction of palmar fascia,


showing contracted fingers. (Burrell.)

Treatment.—There is considerable difficulty in treating these


cases satisfactorily. Cooper advised subcutaneous division of the
tense bands and forcible stretching of the fingers; this rarely proves
sufficient. Adams advocated multiple sections made with a small
tenotome, which is more effective. The best method is that of
Kocher, which consists in excision of the fascial bands by longitudinal
incisions along the cords, and the dissection of the skin from the
underlying fascia. The cord is carefully dissected, with its
prolongations and then completely removed, while the margins of
the skin wounds are closed with sutures. The more thoroughly the
dissection is performed the more satisfactory the result. The fingers
should be straightened and kept from contraction by the use of a
mechanical device. In desperate cases the entire skin of the palm
has been removed, with the diseased fascia, and a plastic operation
made with skin taken from the thigh or the chest, the flap being
sutured in place but not detached completely for ten to twelve days.
Two somewhat allied conditions involving the hand and the foot
are the so-called lock or trigger-finger and hammer-toe.

LOCK OR TRIGGER-FINGER.
Lock or trigger-finger implies a peculiar obstruction to free
movement of the finger, which requires extra effort and then is
overcome quickly, as if a knot had been slipped through a small
opening. It is supposed to be due to a thickening of the tendon at
some point, as by a small fibroma, which becomes entangled along
the course of the sheath, through which it is moved with difficulty. It
is probably due to a local irritation, as in the case of Dupuytren’s
contraction. Injury to the tendon sheath may also produce a similar
condition.
Treatment.—Should it fail to respond to rest and massage the
sheath should be opened and the cause of the difficulty sought out
and removed.

HAMMER-TOE.
Hammer-toe produces deformity with more or less ankylosis. An
angle is formed between the first and second phalanges, and the tip
of the toe is made to bear more than its proportion of weight. This
deformity is in large degree due to the use of shoes which are too
short. In consequence there will develop over the protruding joint a
corn or bunion.
Treatment.
—Should the trouble come on in childhood the toes should be
fastened to a straight splint and shoes for a time abandoned, while
later they should be properly adapted to the needs of the case. In
troublesome cases complete excision of the involved joint gives
satisfactory results.

SURGICAL DISEASES OF THE TENDONS AND


TENDON SHEATHS.

TENDOSYNOVITIS.
Acute inflammation of a tendon sheath is known as tendovaginitis
or tendosynovitis. It always implies an infection, and occurs about
the hands and feet. It is a frequent complication of felons. Many
felons begin in such a manner that it is difficult to decide which part
of the fibrous structures of the finger is first involved. Infection
having once occurred within a tendon sheath will travel rapidly until
it meets with a natural barrier. The frequency of these lesions makes
it important to recall here the anatomy of the tendon sheaths of the
hand. There is a common palmar tendon cavity, which connects with
the thumb and little finger and the space above the annular
ligament, but communication with the first, second, and third fingers
is ordinarily destroyed. This accounts for the apparent vagaries of
cases where infection beginning in the thumb spreads to the little
finger before the others are involved. It will also show the location
where incisions should be made.
Fig. 112

Cicatricial contraction and deformity resulting from consequences of neglected


phlegmon and osteomyelitis of hand. (Lexer.)

Suppurative Tendosynovitis.—Suppurative tendosynovitis


needs prompt intervention, as
adhesions may result from retention of exudate, or lest necrosis of
tendon occur from perversion of its nutritive supply. Ordinarily it is
the result of a local infection, perhaps through a small, trifling
surface irritation, but it results occasionally as a metastatic
expression of gonorrhea, or distinct septic infection. A gonorrheal
tendosynovitis is, however, less likely to suppurate, but more likely to
assume the plastic form and interfere with function by producing
adhesions between a tendon and its sheath. The combination of
virulent bacteria and susceptible tissues will produce local
destruction in almost as short a time as in the appendix. The pain is
intense, because of the inelasticity of the structures.
—Every appearance of this kind calls for early incision, by which not
only the skin but the tendon sheath as well should be freely incised.
An incision at either end of the involved sheath, with flushing and
drainage, may save a tendon and preserve function. Incision should
not be delayed, as destruction may have occurred and deformity be
the result. When the common palmar sheath is involved a long
incision from the base of the index finger, around the base of the
Treatment.thumb
Fig. 113
and up the wrist to a
point considerably
above the annular
ligament, will afford
considerable relief. It
will, moreover,
shorten the time of
ultimate restoration
of function.
—Chronic
tendosynovitis may
be the result of
rheumatism, in which
case it assumes the
plastic form, or of
gonorrhea; the same
being true of a
tuberculous invasion,
which may vary much
in intensity. In the
subacute forms the
deposition of
tubercles may lead to
a plastic outpour
Suppurative tendosynovitis (felon), with sloughing which, being
tendons and necrotic bone. Unfortunately poulticed detached by constant
for two weeks. (Lexer.) motion of the parts, is
Chronic Tendosynovitis. broken into masses
whose minute portions become
rounded off by friction and condensed by time, and appear as the
so-called “melon-seed or rice-grain bodies.” Some of the same
material may be found adherent to the walls of such a cavity. In
slower forms there is less tendency to plastic outpour, but much
more to the formation of granulation tissue, such as is seen in
tuberculous lesions in all parts of the body. When, therefore, a case
of this general character presents we have the signs of local
tuberculosis, or of dropsy of the tendon sheaths, with the fluctuation
somewhat modified by the presence in the fluid of rice-grain or
melon-seed bodies. Should, in such a case, an acute infection be
added we will have the chronic symptoms merged suddenly into
acute. A tendovaginitis of this type appears as a ridge or swelling
along the course of one or more tendons. It will be elastic and
fluctuate in proportion to the distention of the sheath. When the
palmar bursa is involved there is usually, in the palm of the hand, a
bag of fluid which may be forced above the wrist by pressure, while
frequently the little bodies above described are recognizable by the
sensations (crepitus) which they produce. The plastic type rarely
proceeds to suppuration or ulceration unless secondarily infected.
The granulation type proceeds to ulceration and destruction.
Treatment.—Treatment of the rheumatic and gonorrheal forms is at
first rest, with later passive and forced motion, in order to break up
adhesions and prevent their re-formation. If one wait too long he
meets with great difficulty in these efforts and the cases become
exceedingly tedious. Forcible motion should be practised under
nitrous oxide anesthesia and should be repeated every two or three
days. Meanwhile massage should be employed. If pain or reaction
be extreme ice-cold applications should be applied. Extreme swelling
may be combated by the use of a rubber glove. If this be worn,
ichthyol-mercurial ointment should be used beneath it, in order to
promote absorption.
Treatment of the tuberculous cases is often disappointing. Non-
operative measures afford but temporary benefit, while operation to
be effective should be thorough. It should consist of free incision,
with exposure in whole or in part of the affected channel or cavity,
thorough cleaning out of its contents, removal of all edematous or
tuberculous tissue or granulations, and the use of an antiseptic as
strong as it can be employed.
The new opsonic serum treatment, now being placed on trial as
this work goes to press, promises much in the treatment of all these
septic affections, though detailed statements would be premature.
TENDOPLASTY.
It was a step in advance in surgical technique when Stromeyer
and Dieffenbach, in 1842, introduced the method of subcutaneous
division of tendons and aponeuroses, and showed how easily
contracted tendons could be lengthened by tenotomy. From their
time until somewhat recently tenotomy has held its place in the
treatment of various deformities, and until Anger, Gluck, Hoffa, and
others have taught the surgical profession what can be done by
various plastic and suture methods in overcoming defects and
atoning for loss of function in paralyzed muscles. To the surgery of
tendons and muscle terminations have been added the further
resources of tendon suture, i. e., tenorrhaphy, and tendoplasty, by
which latter something more than the mere suture is meant, i. e.,
the plastic rearrangement and grafting of tendons one upon another.
[20]

[20] The method of transplanting one tendon upon another is to be


credited to Nicoladoni, who perfected it in 1882. Later it fell into disuse, but
was revived in this country, especially by Goldthwait, of Boston, in 1896.
Fig. 114 Fig. 115

Fig. 116 Fig. 117 Fig. 118


Fig. 119 Fig. 120 Fig. 121

Illustrating various methods of dealing with tendons in tendoplasty. (After Vulpius.)


Tendon suture is practised as an emergency measure when one or
more tendons has been accidentally divided, this being considered
now as much a part of the surgeon’s duty as to close any other part
of the wound. No additional resource or expedient is needed, it
being necessary only to observe the principles of asepsis, which
should be maintained in every case. A tendon raggedly divided
should be cleanly cut and its edges brought together with formalin-
gut or freshly boiled silk. A series of divided tendons should be
treated after the same fashion, matching the ends as closely and
completely as possible. After uniting the tendon ends, if the case be
clean, the tendon sheath should be closed and the parts put at rest,
in such a position that no tension is made upon the injured sinew
until it is seen to have united.
Fig. 122 Fig. 123

Shortening a tendon.
It was a great service, in which perhaps Gluck figured most
conspicuously, to show that when tendon ends could not be neatly
coapted an animal material could be interposed in such a way as to
serve as a trellis along which cells could group, or around which they
might organize, and thus gradually and finally become a part of the
complete tendinous cord. Silk and catgut have best served this
purpose, and new tendons have gradually formed around these
artificial substitutes, to the length of 10 Cm. In every fresh case
where there has been such loss of original structure as to justify a
measure of this kind, or in certain old cases where tendons have
long since sloughed away, it may be possible to resort to these
expedients.
It has been possible to transplant fresh tendons from the smaller
animals and to see them serve the same purpose in a satisfactory
manner.
Among these methods of tendoplasty is tendon grafting, by which
a part or all of the tendon of an active muscle is inserted into the
terminal portion of a paralyzed muscle and thus made to assume to
a greater or less extent the purpose and function of the latter; in
other words it assists in ingeniously diverting the activity and
direction of a given muscle to a purpose different from its original
intent. By this diversion a more equal or equable distribution of
muscle force is afforded the parts into which the affected muscles
are inserted. For its successful performance only those muscles
which are still active can be utilized. Among the simplest of cases
where this expedient can be used are those produced by traumatic
and peripheral paralyses, or traumatic loss of a given tendon or a set
of tendons. It is rarely to be practised as an emergency measure,
but as an expedient to be availed of later. It finds its greatest
usefulness in cases of long standing. It is equally applicable where
muscles and tendons have been divided by injury, or paralyzed by
injury to their nerve supply, as well as where deformities are
produced by chronic neurotic disturbance, by scars, by excessive
callus, etc. It proves equally serviceable in paralyses of spinal origin,
particularly those due to anterior poliomyelitis.
Tendon grafting will serve both as a substitute in cases of lost
function and as a provision against future deformity. In cases of the
ordinary paralyses of children, tendoplasty should be deferred for
several months after the occurrence of the paralysis. In the case of
growing children it is desirable not to wait too long, as other
objectionable features may present themselves. In the congenital
and hereditary paralyses and in conditions like athetosis or the
dystrophies of syringomyelia, meningocele, etc., also in such
conditions as habitual dislocations of the patella, much can be
accomplished by a carefully planned tendoplasty. It will be easily
seen then how wide a field of usefulness lies before one who
familiarizes himself with the recent technique of tendon surgery.

Fig. 124

Fig. 125

Two methods of tendon implantation and fixation. (After Vulpius.)


Fig. 126 Fig. 127 Fig. 128

Transplantation of a portion of the anterior tibial tendon, into the bone or into the
opposed group of muscles. (After Vulpius.)

So far as technical considerations are concerned these operations


should be performed only with the minutest attention to asepsis.
When this has been secured a permanent dressing may be applied,
the limb being left in the position most desired, and maintained
there for several weeks. For this plaster of Paris makes the best
support. The use of the rubber bandage will permit the operation to
be bloodlessly made, by which it is greatly facilitated. If careful
suturing be practised, there will be but little tendency to subsequent
oozing or interference with repair. Fine discrimination is always
needed in the matter of adjusting the length of tendon ends and the
point of their fixation. A useless tendon which has been long
stretched over a curved joint will have become elongated, and the
tendon to be applied to it should be affixed farther down than would
be otherwise necessary. The disposition of the upper portion of the
useless tendon and muscle may also call for serious attention. It is
rarely necessary to extirpate them. They are already atrophied, and
to remove them would be to still further reduce the dimensions of
the part. The excluded portions can thus be simply discarded. When
there has been deformity with more or less pseudo-ankylosis the
malposition should be forcibly redressed and the tendon grafting
deferred until a subsequent time; the latter, to be successful, should
be performed alone.
Incisions are usually made along and over the course of the
tendons to be exposed, but not so close that the cutaneous scar can
interfere with the tendon sheath. The lower end of a paralyzed
muscle will appear very differently from that of one which is healthy;
in the former instance the tissue will have lost its muscular character,
and will be yellowish white and fatty. A fascia which has been
stretched out of shape may be sutured in folds and will serve of
itself to give support and shape to the part which is renewed.
The methods of uniting tendons are so numerous that they can be
better estimated by a glance at the accompanying diagrams after
Vulpius than by description (Figs. 124 to 128). It is not necessary to
utilize all of the tendon of a healthy muscle, as it can be split and a
portion diverted to its new function. It is not to be expected that
tendons thus arranged will perfectly serve their purpose the first
time they are used. There must elapse a period of education of the
nerves and muscles whose relations are thus altered, and
improvement in the use of the parts thus operated will accrue for
months and even years. It is desirable that tendon surfaces thus
applied to each other be made broad and extensive in order that
their adhesion may be more firm.
A modification of tendon grafting consists in implanting the tendon
end into the periosteum instead of into some other tendon. There
are various ways of making this implantation, either by simple suture
or by boring into the bone or canalizing under a periosteal bridge.
Fig. 129 illustrates how the tendon of the tibialis anticus can be
utilized in both ways. It will thus be seen that a tendon can be given
either tendinous, periosteal, or osteal implantation. Tendons thus
utilized rarely undergo necrosis or degeneration. So long as the
possibility of infection be excluded almost anything can be done with
these structures, in spite of their apparent lack of vascularity and
vitality.
There are times when it is necessary to lengthen a tendon as well
as to shorten it. Fig. 129 illustrates methods by which both of these
measures can be performed. Analogous methods have been
practised with muscles themselves, although here the circumstances
are different and nothing similar can be accomplished. Portions of
Fig. 129
the pectoralis major
have been grafted
into the biceps for
paralysis of the latter.
Liberating the ring
finger in musicians,
by dividing the
accessory tendons of
the extensor
communis digitorum,
is an expedient
suggested some
years ago by Brinton.
It is made by an
incision less than a
quarter of an inch
long, through the skin
Showing methods of lengthening tendons. (Burrell.) and fascia, just below
the carpal articulation
of the metacarpal bone of the ring finger, and above the radial
accessory slip, parallel with and on the radial aspect of the extensor
tendon of that finger. The point of a narrow blunt-pointed bistoury is
then inserted flatwise beneath the accessory slip down to a point
just in front of the knuckles of the ring and middle fingers, where
the blunt point should be felt beneath the skin. The bistoury is now
turned upward, the middle finger strongly flexed, and the ring finger
extended so as to make the slip tense when it is divided. The
accessory slip on the other side of the extensor tendon is similarly
divided through a distinct incision. Snug compression is made with a
bandage over the wounds, with the thumb free, and after two days
the patient is permitted to use the fingers in piano-playing in order
to prevent reunion of cut surfaces.

MYOTOMY AND TENOTOMY.

You might also like