Java-Struts
Published by SourceBeat, LLC, Highlands Ranch, Colorado.
Managing Editor: Technical Editor: Copy Editor: Layout Designer: Cover Designer:
James Goodwill Kelly Clauson Brent Barkley Amy Kesic Max Hays
ISBN: 0974884308
Many designations usedby organizations to distinguish their products are claimed as trademarks. These trademarked names may appear in this book. We use the names in an editorial fashion only with no intention of infringing on the trademark; therefore you will not see the use of a trademark symbol with every occurrence of the trademarked name. As every precaution has been taken in writing this book, the author andpublisher will in no way be held liable for any loss or damages resulting from the use of information contained in this book.
Table of Contents
Dedication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . ix About the Author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi Introduction . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xii Chapter 1: Struts Quick Start Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Download Struts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Set up a J2EE Web Application Project That Uses Struts .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Write Your First Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Write Your First “Forward” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Configure the Action and Forward in theStruts Configuration File . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Run and Test Your First Struts Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Debug Struts-Config.xml with the Struts Console . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Add Logging Support with Log4J and Commons Logging . . . . . . . . .. . . . . . . . . . . . . . . . . . . 13 Write Your First ActionForm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Write Your First Input View (JSP Page) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Update the Action to Handle the Form and Cancel Buttons . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . 27 Set up the Database Pooling with Struts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Exception Handling with Struts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Display an Object with Struts Tags . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . 35 Using Logic Tags to Iterate over Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 Chapter 2: Testing Struts . . . . . . . . . . . . . . . . . ....
Regístrate para leer el documento completo.