E-Book, Englisch, 536 Seiten
Doray Beginning Apache Struts
1. ed
ISBN: 978-1-4302-0129-8
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
From Novice to Professional
E-Book, Englisch, 536 Seiten
ISBN: 978-1-4302-0129-8
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
The only current developer-driven book positioned and based on Apache Struts 1.2 (which is still the most widely used and most popular MVC-based web application development framework) Condensed tutorial and lab format, where material has been tested in actual class settings Includes some preview coverage of the next generation of Struts (2.x), otherwise known as Apache Shale
Arnold Doray is Thinksquared's lead software architect and has been developing software professionally for over a decade. He has conducted several developer training courses in the U.K. and Singapore. Arnold holds a bachelor's degree in physics and a master's degree in knowledge engineering.
Autoren/Hrsg.
Weitere Infos & Material
1;Contents at a Glance;6
2;Contents;8
3;About the Author;20
4;About the Technical Reviewer;21
5;Acknowledgments;22
6;PART 1 Basic Struts;23
6.1;CHAPTER 1 Introduction;25
6.1.1;What Is a Web Application?;25
6.1.2;What Struts Can Do for You;26
6.1.3;About You;27
6.1.4;How to Read This Book;27
6.1.5;Useful Links;28
6.2;CHAPTER 2 Servlet and JSP Review;29
6.2.1;Lab 2: Installing Tomcat;29
6.2.2;Servlet Container Basics;32
6.2.3;Important Servlet Classes;34
6.2.4;JavaServer Pages (JSP);35
6.2.5;Useful Links;38
6.2.6;Summary;38
6.3;CHAPTER 3 Understanding Scopes;39
6.3.1;Lab 3: Scopes Quiz;40
6.3.2;Session and Request Scope Internals;42
6.3.3;Summary;43
6.4;CHAPTER 4 Custom Tags;45
6.4.1;Custom Tag Basics;45
6.4.2;How Custom Tags Are Processed;46
6.4.3;The Java Handler Classes;48
6.4.4;Helper Classes;50
6.4.5;The TLD File;51
6.4.6;Lab 4: A Temperature Conversion Tag;53
6.4.7;Professional Java Tools;57
6.4.8;Useful Links;57
6.4.9;Summary;57
6.5;CHAPTER 5 The MVC Design Pattern;59
6.5.1;The Registration Webapp;61
6.5.2;Lab 5: MVC Quiz;67
6.5.3;Which Comes First?;68
6.5.4;Struts and MVC;69
6.5.5;Lifecycle of a Struts Request;70
6.5.6;Frameworks for the Model;71
6.5.7;Useful Links;72
6.5.8;Summary;73
6.6;CHAPTER 6 Simple Validation;75
6.6.1;Processing Simple Validations;75
6.6.2;Anatomy of ActionForm;76
6.6.3;Using ActionErrors;79
6.6.4;Lab 6: ContactForm for LILLDEP;83
6.6.5;What Has Struts Done for You Today?;86
6.6.6;Summary;87
6.7;CHAPTER 7 Processing Business Logic;89
6.7.1;1,2,3 Action!;89
6.7.2;The Statelessness of Action;90
6.7.3;Subclassing Action;91
6.7.4;Business Logic in the Registration Webapp;92
6.7.5;Complex Validation;95
6.7.6;Data Transformation;96
6.7.7;Navigation;97
6.7.8;Lab 7: Implementing ContactAction for LILLDEP;98
6.7.9;Summary;99
6.8;CHAPTER 8 Basic Struts Tags;101
6.8.1;Page Processing Lifecycle;102
6.8.2;The View Component of the Registration Webapp;104
6.8.3;Synopsis of HTML and Bean Tag Libraries;110
6.8.4;Lab 8: Contact Entry Page for LILLDEP;112
6.8.5;Useful Links;113
6.8.6;Summary;113
6.9;CHAPTER 9 Configuring Struts;115
6.9.1;The Structure of struts-config.xml;115
6.9.2;Configuring the Registration Webapp;116
6.9.3;Declaring Form Beans;117
6.9.4;Declaring Global Exceptions;118
6.9.5;Declaring Global Forwards;119
6.9.6;Declaring Form Handlers;120
6.9.7;Controller Declaration;122
6.9.8;Message Resources;123
6.9.9;Declaring Plug-ins;123
6.9.10;Lab 9a: Configuring LILLDEP;124
6.9.11;Code Reuse;125
6.9.12;Lab 9b: The MNC Page;126
6.9.13;Summary;127
6.10;CHAPTER 10 More Tags;129
6.10.1;Best Practices;130
6.10.2;The 2 + 1 Remaining Struts Libraries;130
6.10.3;The Logic Tag Library;131
6.10.4;The Nested Tag Library;137
6.10.5;JSTL and Struts;140
6.10.6;Struts EL Extensions;146
6.10.7;Lab 10a: The LILLDEP Full Listing Page;147
6.10.8;Lab 10b: Simplifying ContactForm;148
6.10.9;Lab 10c: Using JSTL;149
6.10.10;Useful Links;149
6.10.11;Summary;150
6.11;CHAPTER 11 Uploading Files;151
6.11.1;Uploading a Fixed Number of Files at Once;153
6.11.2;Uploading Any Number of Files;155
6.11.3;Lab 11: Importing Data into LILLDEP;162
6.11.4;Useful Links;164
6.11.5;Summary;164
6.12;CHAPTER 12 Internationalization;165
6.12.1;Character Encodings, Unicode, and UTF-8;165
6.12.2;Locales;168
6.12.3;Processing Input;168
6.12.4;Localizing Validations;169
6.12.5;Localizing Output;172
6.12.6;Lab 12: LILLDEP for the Malaysian Market;176
6.12.7;Useful Links;177
6.12.8;Summary;177
6.13;CHAPTER 13 Review Lab: Editing Contacts in LILLDEP;179
6.13.1;Implementing the Edit Facility;180
7;PART 2 Advanced Struts;181
7.1;CHAPTER 14 Tiles;183
7.1.1;Installing Tiles;184
7.1.2;Tiles for Layout;185
7.1.3;Tiles Components;191
7.1.4;Example: The “Login” Tiles;195
7.1.5;Getting External Form Data;209
7.1.6;Lab 14: The Find Facility;209
7.1.7;Summary;215
7.2;CHAPTER 15 The Validator Framework;217
7.2.1;Declaring the Validator Plug-in;218
7.2.2;Validator DTD Basics;219
7.2.3;Using the Validator Framework;220
7.2.4;The Standard Validators;227
7.2.5;Adding Custom Validations;231
7.2.6;Migrating Legacy Code;238
7.2.7;Localizing Validations;239
7.2.8;Lab 15: Using the Validator Framework in LILLDEP;240
7.2.9;Useful Links;240
7.2.10;Summary;241
7.3;CHAPTER 16 Dynamic Forms;243
7.3.1;Declaring Dynamic Forms;243
7.3.2;Accessing Dynamic Properties;247
7.3.3;Dynamic Form Disadvantages;248
7.3.4;Validating Dynamic Forms;249
7.3.5;The Registration Webapp with Dynamic Forms;250
7.3.6;See Ma, No Hands!: LazyValidatorForm (Struts 1.2.6+);254
7.3.7;The Hidden Power of BeanValidatorForm (Struts 1.2.6+);257
7.3.8;Lab 16: Deleting Selected Contacts in LILLDEP;258
7.3.9;Useful Links;259
7.3.10;Summary;260
7.4;CHAPTER 17 Potpourri;261
7.4.1;PropertyUtils;262
7.4.2;DownloadAction (Struts 1.2.6+);265
7.4.3;LocaleAction;267
7.4.4;IncludeAction and ForwardAction;269
7.4.5;LookupDispatchAction;271
7.4.6;DispatchAction;276
7.4.7;MappingDispatchAction;277
7.4.8;Using Global Forwards;280
7.4.9;Logging;280
7.4.10;Using Wildcards;283
7.4.11;Splitting up struts-config.xml;285
7.4.12;Useful Links;288
7.4.13;Summary;288
7.5;CHAPTER 18 Review Lab: The Collection Facility;289
7.5.1;Lab 18a: The Main Collect Page;290
7.5.2;Lab 18b: The New Collection Page;291
7.5.3;Lab 18c: The Collection Listing Page;293
7.5.4;Lab 18d: Removing Selected Contacts;294
7.5.5;Lab 18e: Adding Selected Contacts;295
7.5.6;Lab 18f: Up and Down a Search;297
7.5.7;Summary;298
7.6;CHAPTER 19 Developing Plug-ins;299
7.6.1;The Task at Hand;299
7.6.2;Implementation Road Map;302
7.6.3;How Struts Processes Form Beans;303
7.6.4;Anatomy of a Plug-in;306
7.6.5;Implementing DynaFormsPlugIn;307
7.6.6;Reading XML with Apache’s Digester;310
7.6.7;Implementing DynaFormsLoaderFactory;313
7.6.8;DefaultDynaFormsLoader;316
7.6.9;Lab 19: Test Driving the DynaForms Plug-in;324
7.6.10;Extra Credit Lab: Handling ;325
7.6.11;Useful Links;327
7.6.12;Summary;328
7.7;CHAPTER 20 JavaServer Faces and Struts Shale;329
7.7.1;JSF Overview;329
7.7.2;Shale Overview;330
7.7.3;Learning Struts a Waste of Time?;332
7.7.4;JavaServer Faces (JSF);332
7.7.5;Example: The Registration Webapp;344
7.7.6;Where to Next?;358
7.7.7;Lab 20: The Struts-Faces Integration Library;359
7.7.8;Struts Shale Preview;365
7.7.9;JSF vs. Shale vs. Struts;377
7.7.10;Useful Links;379
7.7.11;Summary;380
7.8;APPENDIX A Frameworks for the Model;381
7.8.1;Getting the Software;382
7.8.2;Lisptorq;382
7.8.3;Lab A: Test Driving Lisptorq;385
7.8.4;Using Torque for the Registration Webapp;388
7.8.5;Using Hibernate for the Registration Webapp;389
7.8.6;Autogenerating LILLDEP Model Classes;392
7.8.7;Useful Links;395
7.9;APPENDIX B Commonly Used Classes;397
7.9.1;javax.servlet.http.HttpServletRequest;397
7.9.2;javax.servlet.http.HttpSession;398
7.9.3;org.apache.struts.action.ActionMessage;398
7.9.4;org.apache.struts.action.ActionMessages;399
7.9.5;org.apache.struts.action.ActionMapping;399
7.9.6;org.apache.struts.action.Action;399
7.9.7;org.apache.struts.action.ActionForm;400
7.9.8;org.apache.struts.upload.FormFile;401
7.9.9;org.apache.struts.tiles.ComponentContext;402
7.9.10;org.apache.struts.action.ExceptionHandler;402
7.10;APPENDIX C Struts Tag Reference;403
7.10.1;The HTML Tag Library;403
7.10.2;The Bean Tag Library;443
7.10.3;The Logic Tag Library;458
7.10.4;The Nested Tag Library;473
7.10.5;The Tiles Tag Library;479
7.11;APPENDIX D Answers;491
7.11.1;Chapter 1: Introduction;491
7.11.2;Chapter 3: Understanding Scopes;492
7.11.3;Chapter 5: The MVC Design Pattern;493
7.11.4;Chapter 6: Simple Validation;493
7.11.5;Lab 8: Contact Entry Page for LILLDEP;494
7.11.6;Lab 9a: Configuring LILLDEP;495
7.11.7;Lab 9b: The MNC Page;495
7.11.8;Chapter 10: More Tags;496
7.11.9;Lab 10a: The LILLDEP Full Listing Page;497
7.11.10;Lab 10b: Simplifying ContactForm;497
7.11.11;Lab 11: Importing Data into LILLDEP;497
7.11.12;Chapter 13: Review Lab;498
7.11.13;Chapter 14: Tiles;498
7.11.14;Chapter 15: The Validator Framework;499
7.11.15;Chapter 17: Potpourri;499
7.11.16;Chapter 20: JavaServer Faces and Struts Shale;499
8;Index;501




