Synopses & Reviews
JavaServer Pages (JSP) is a cross-platform language that generates dynamic Web pages and uses XML-like tags written in Java to create content. With its latest release, version 2.0, JSP has become an even more powerful tool that beginners often find challenging to learn. This book provides you with an accessible introduction to JSP.
Packed with real-world code examples and in-depth case studies accompanied by fully working applications, this book introduces the many new features of JSP 2.0 while emphasizing good Web development practices. Along the way, you'll examine how JSP interacts with other Enterprise Java technologies and you'll be challenged to apply your new JSP programming skills to real-world projects.
What you will learn from this book
- JSP fundamentals, including JSP syntax and directives, JSP Expression Language, Tag libraries, and techniques for testing and debugging
- How to develop multilingual Web sites with JSP
- How JSP interacts with other Enterprise Java technologies
- Ways to use JSP with Web frameworks, such as Struts, Spring, WebWork, and JavaServer Faces, and persistence frameworks, such as Hibernate, to build real-world Web applications
- Software design methodologies and developer tools such as Ant, jUnit, jMeter, CVS, and more
- How to use the right tools, design patterns, and frameworks effectively and appropriately for developing applications
Who this book is for
This book is for novice programmers who have basic programming experience either in Java or a Web scripting language and want to become fluent in JSP.
- JSP is one of the core technologies for server-side Java applications and the 2.0 release, which this book covers in detail, makes JSP an even more powerful tool
- Walks Java programmers and Web developers through JSP fundamentals, including JSP syntax and directives, JSP Expression Language, JSP Tag libraries, JSTL, and techniques for testing and debugging
- Shows how to use JSP in real-world Web applications along with open source frameworks such as Struts, WebWork, and Turbine, software design methodologies, and developer tools like Ant, jUnit, and CVS, as well as popular IDEs (integrated development environmnents)
- Each chapter has an exercise section with solutions on the companion Web site
JSP is one of the core technologies for server-side Java applications and the 2.0 release, which this book covers in detail, makes JSP an even more powerful tool Walks Java programmers and Web developers through JSP fundamentals, including JSP syntax and directives, JSP Expression Language, JSP Tag libraries, JSTL, and techniques for testing and debugging Shows how to use JSP in real-world Web applications along with open source frameworks such as Struts, WebWork, and Turbine, software design methodologies, and developer tools like Ant, jUnit, and CVS, as well as popular IDEs (integrated development environmnents) Each chapter has an exercise section with solutions on the companion Web site
About the Author
has over ten years of experience as a software developer, architect, and team lead, with extensive experience with Web services, J2EE, and middleware technologies. He has worked and consulted at a number of Silicon Valley companies and startups and has (pending) patents on Web services. Vivek actively writes about technology and has coauthored half a dozen books on topics such as opensource software, Java, XML, and Web services. He contributes to open source, too, and has developed parts of the uddi4j library, an open-source Java API for UDDI.
Sing Li, first bit by the microcomputer bug in 1978, has grown up with the microprocessor age. His first personal computer was a do-it-yourself Netronics COSMIC ELF computer with 256 bytes of memory, mail-ordered from the back pages of Popular Electronics magazine. Currently, Sing is a consultant, system designer, open-source software contributor, and freelance writer. He writes for several popular technical journals and e-zines and is the creator of the Internet Global Phone, one of the very first Internet phones available. He has authored and coauthored numerous books across diverse technical topics, including JSP, Tomcat, servlets, XML, Jini, and JXTA.
Rupert Jones is a Technical Lead for J2EE projects at Internet Business Systems. Over the past six years, Rupert has provided software development and consulting services for blue-chip companies, both in Australia and internationally. He lives and works in Melbourne, Australia. Rupert can be contacted at email@example.com.
Jon Eaves has been developing software in a variety of languages and domains for over 15 years. He is currently employed by ThoughtWorks, developing large-scale enterprise systems using J2EE. When he can find spare time, he develops J2ME/MIDP applications and works on the BouncyCastle Crypto APIs (www.bouncycastle.org). Jon can be reached at firstname.lastname@example.org.
John T. Bell has more than 20 years of software development experience and currently serves as the lead software architect for the Web site of a major hospitality company based in Bethesda, Maryland. He is also an adjunct professor, teaching server-side Java technologies for the Center for Applied Information Technology at Towson State University. He has a master’s degree in Computer Systems Management and a bachelor’s degree in Electrical Engineering, both from the University of Maryland. This is Mr. Bell’s third contribution to a Wrox title. He is also the author of The J2EE Open Source Toolkit.
Table of Contents
About the Authors v
The Right Way to Do Web Development xxv
How This Book Is Structured xxvi
Source Code xxx
Part I: JSP Fundamentals 1
Chapter 1: Getting Started with JavaServer Pages 3
Chapter 2: JSP Basics 1: Dynamic Page Creation for Data Presentation 31
Chapter 3: JSP Basics 2: Generalized Templating and Server Scripting 73
Chapter 5: JSP and EL 145
Chapter 6: JSP Tag Libraries and JSTL 179
Chapter 7: JSP Directives 213
Chapter 8: JSP Standard Actions 241
Chapter 9: JSP and JavaBeans 275
Chapter 10: Error Handling 303
Chapter 11: Building Your Own Custom JSP Tag Library 329
Chapter 12: Advanced Dynamic Web Content Generation 361
Chapter 13: Internationalization and Localized Content 395
Chapter 14: JSP Debugging Techniques 435
Part II: JSP and Modern Web Server Software Development 481
Chapter 15: JSPs and Servlets 483
Chapter 16: The Role of JSP in the Wider Context: Web Applications 511
Chapter 17: Model View Controller 533
Chapter 18: Web Frameworks 549
Chapter 19: Struts Framework 591
Chapter 20: Layout Management with Tiles 643
Chapter 21: JavaServer Faces 681
Chapter 22: JSP in J2EE 721
Chapter 23: Access to Databases 747
Chapter 24: Security 825
Chapter 25: Performance 861
Chapter 26: Best Practices and Tools 885
Part III: Spreading Your New Wings: Applying JSP in the Real World 923
Chapter 27: JSP Project I: Personalized Portal 925
Chapter 28: JSP Project II: Shopping Cart Application 983
Part IV: Appendixes 1057
Appendix A: JSP Syntax Reference 1059
Appendix B: JSP Expression Language Reference 1077
Appendix C: JSTL Reference 1089
Appendix D: Exercise Solutions 1123