logo资料库

Murachs Java Servlets and JSP(3rd) 无水印pdf.pdf

第1页 / 共767页
第2页 / 共767页
第3页 / 共767页
第4页 / 共767页
第5页 / 共767页
第6页 / 共767页
第7页 / 共767页
第8页 / 共767页
资料共767页,剩余部分请下载后查看
Cover
Content
Expanded Contents
Introduction
1 - Get Started Right
1 - An Introduction to Web Programming with Java
An Introduction to Web Applications
Three Approaches for Java Web Applications
An Introduction to Servlet/JSP Web Development
Software for Developing Java Web Applications
Perspective
2 - How to Structure a Web Application with the MVC Pattern
Two Patterns for Servlet/JSP Applications
A Servlet/JSP Application That Uses the MVC Pattern
Perspective
3 - How to Use NetBeans and Tomcat
How to Get Started with NetBeans
How to Work with HTML and JSP Files
How to Work with Java Files
How to Work with XML Files
Other Skills for Working with Web Applications
Perspective
Exercise 3-1 - Install and Use the NetBeans IDE
Exercise 3-2 - Experiment with an Existing Application
Exercise 3-3 - Run Web Applications That Use a Database
2 - Essential Servlet and JSP Skills
4 - A Crash Course in HTML5 and CSS3
How to Work with HTML
How to Work with CSS
How to Code HTML Forms
Perspective
Exercise 4-1 - Modify a Web Page
5 - How to Develop Servlets
How to Create and Map a Servlet
How to Request a Servlet
Skills for Working with Servlets
How to Validate Data
How to Work with the web.xml File
More Skills for Working with Servlets
How to Work with Servlet Errors
Perspective
Exercise 5-1 - Modify the Servlet for the Email List Application
Exercise 5-2 - Create a New Servlet
6 - How to Develop JavaServer Pages
A Crash Course in EL and JSTL
How to Use JSP Tags
How to Use Standard JSP Tags with JavaBeans
How to Include a File in a JSP
How to Fix Common JSP Errors
Perspective
Exercise 6-1 - Modify the JSPs for the Email List Application
Exercise 6-2 - Create a New JSP
7 - How to Work with Sessions and Cookies
An Introduction to Session Tracking
How to Work with Sessions
How to Work with Cookies
How to Work with URL Rewriting and Hidden Fields
The Download Application
Perspective
Exercise 7-1 - Use a Cookie
Exercise 7-2 - Use a Session Attribute
Exercise 7-3 - Use URL Rewriting Instead of Hidden Fields
8 - How to Use EL
An Introduction to JSP Expression Language
Essential Skills for Working with EL
Other Skills for Working with EL
Perspective
Exercise 8-1 - Modify the Email List Application
9 - How to Use JSTL
An Introduction to JSTL
How to Work with the JSTL Core Library
The Cart Application
Perspective
Exercise 9-1 - Use JSTL in the Download Application
Exercise 9-2 - Use JSTL in the Cart Application
10 - How to Use Custom JSP Tags
How to Code a Custom Tag That Doesn't Have a Body
How to Code a Custom Tag That Has a Body
How to Code a Custom Tag That Has Attributes
How to Code a Custom Tag That Reiterates its Body
How to Work with Scripting Variables
Classes, Methods, and Fields for Working with Custom Tags
Perspective
Exercise 10-1 - Create and Use a Custom Tag
Exercise 10-2 - Create and Use a Reiterating Tag
3 - Essential Database Skills
11 - How to Use a MySQL Database
An Introduction to MySQL
How to Use MySQL Workbench
The SQL Statements for Creating a Database
The SQL Statements for Data Manipulation
Perspective
Exercise 11-1 - Review a SQL Script
Exercise 11-2 - Use MySQL Workbench
12 - How to Use JDBC to Work with a Database
How to Work with JDBC
The SQL Gateway Application
How to Work with Connection Pooling
The Email List Application
Perspective
Exercise 12-1 - Implement Connection Pooling
Exercise 12-2 - Create a User Admin Application
13 - How to Use JPA to Work with a Database
An Introduction to JPA
How to Code JPA Entities
How to Retrieve Data
How to Modify Data
A Complete JPA Class
Perspective
Exercise 13-1 - Test and Modify the Email List Application
Exercise 13-2 - Create a User Admin Application
4 - Advanced Servlet and JSP Skills
14 - How to Use JavaMail to Send Email
An Introduction to the JavaMail API
How to Create and Send an Email Message
Example Classes That Send an Email Message
Perspective
Exercise 14-1 - Send an Email from a Servlet
15 - How to Use SSL to Work with a Secure Connection
An Introduction to SSL
How to Configure a Testing Environment for SSL
How to Work with a Secure Connection
Perspective
Exercise 15-1 - Configure and Test a Secure Connection
16 - How to Restrict Access to a Web Resource
An Introduction to Authentication
How to Restrict Access to Web Resources
How to Implement a Security Realm
How to Allow Access to Authorized Users
Perspective
Exercise 16-1 - Work with Authentication Types
17 - More Security Skills
An Introduction to Website Security
How to Protect Passwords
Perspective
Exercise 17-1 - Test the PasswordUtil Class
18 - How to Work with HTTP Requests and Responses
An Introduction to HTTP
How to Work with the Request
How to Work with the Response
Practical HTTP Skills
Perspective
Exercise 18-1 - Work with Requests and Responses
19 - How to Work with Listeners
How to Use a ServletContextListener
How to Work with Other Types of Listeners
Perspective
Exercise 19-1 - Work with Listeners
20 - How to Work with Filters
An Introduction to Filters
How to Add a Filter
Two Filter Classes
Other Skills for Working with Filters
Perspective
Exercise 20-1 - Run the Download Application
21 - How to Work with JavaServer Faces
An Introduction to JSF
How to Use Managed Beans
How to Use Standard JSF Tags
The Email List Application
Perspective
Exercise 21-1 - Work with JSF
5 - The Music Store Website
22 - An Introduction to the Music Store Website
The User Interface
The Business Layer
The Controller Layer
The Structure
The Database
The Data Layer
The JPA Version Compared to the JDBC Version
Perspective
23 - The Applications of the Website
The User Interface for End Users
The User Interface for Administrators
Perspective
Exercise 23-1 - Test and Review the Music Store Site
Exercise 23-2 - Test and Review the JPA Version
Exercise 23-3 - Enhance the Site
Appendix A - How to Set Up Your PC for this Book
Appendix B - How to Set Up Your Mac for this Book
Index
I 3RD EDITION
TRAINING & REFERENCE I 3RD EDITION Joel Murach Michael Urban MIKE MURACH & ASSOCIATES, INC. 4340 N. Knoll Ave. • Fresno, CA 93722 www.murach.com • murachbooks@murach.com
Authors: Joel Murach Michael Urban Editor: Ray Halliday Production: Maria Spera Books for Java programmers Murach's Murach's Murach's Java Programming Android Java Servlets and ISP (Jrd Edition) Programming CSS3 Books for web developers Murach's HTML5 and Murach's Murach's Murach's Murach's Dreamweaver JavaScript JavaScript PHP and MySQL andjQuery and DOM Scripting CC Books for .NET programmers Murach's Murach's C# 2012 ASP.NET 4.5 Web Programming with C# 2012 Murach's Murach's ASP.NET 4.5 Basic 2012 Web Programming Visual with VB 2012 Books for database developers Murach's MySQL Murach's Murach's Oracle SQL and PL!SQL SQL Server 2012 for Developers Books for IBM mainframe programmers Murach's Murach's Murach's OS/390 and z/OS JCL Mainframe Cf CS for the COBOL Programmer COBOL Please check www.murach.com for the most up-to-date Murach books © 2014, Mike Murach All rights Printed reserved. in the United States of America & Associates, Inc. 10 9 8 7 6 5 4 3 2 1 ISBN-13: 978-1-890774-78-3
Content Introduction Section 1 Get started right Chapter Chapter Chapter 1 2 3 An introduction How to structure How to use NetBeans to web programming a web application and Tomcat with Java with the MVC pattern 3 29 49 Section 2 Essential servlet and JSP skills HTML5 and CSS3 Chapter Chapter Chapter Chapter Chapter Chapter Chapter 4 5 6 7 8 9 10 A crash course in serv lets How to develop JavaServer Pages How to develop How to work with sessions How to use EL How to use JSTL How to use custom JSP tags and cookies Section 3 Essential database skills 11 12 Chapter Chapter Chapter 13 How to use a MySQL database How to use JDBC to work with a database How to use JPA to work with a database Section 4 Advanced servlet and JSP skills work with a secure to send email Chapter Chapter Chapter Chapter Chapter Chapter Chapter Chapter 14 15 16 17 18 19 20 21 How to use J avaMail How to use SSL to How to restrict More security skills How to work with HTTP requests How to work with listeners How to work with filters How to work with JavaServer access to Faces a web resource and responses connection Section 5 The Music Store website Chapter Chapter 22 23 An introduction The applications to the Music Store website of the website Appendixes Appendix Appendix How to set up your PC for this book How to set up your Mac for this book A B 89 127 173 201 243 269 307 347 377 421 459 483 501 525 543 571 587 613 643 673 691 711
Expanded contents VI I • • Expanded contents Section 1 Get started right Chapter 1 An introduction to web applications ................ web application A typical The components How static How dynamic web pages work ..................................................................................... .................................... .................................... ......................................................... ........................................... ........................................ .................................... of a web application web pages work 4 6 8 10 .................................................................................................................... for Java web applications ................................ Three approaches Servlet/JSP JSF ............................ Spring Framework ................... ............ ...................................................... ................................... .................................................... ................................. An introduction The software components The architectur The standar d directories to servlet/JS P web development ........................ ................ .................................... ......................................... e ...................... ..................................................... ................................. for developing Java web applications ............................ Java web applications .......... ........................................ ............ ................ ................................. .................... ........ for Java web applications for Java web applications Java web applications ............................. .................................. ................................. ..................................... Chapter 2 a web application for servlet/JS P applications ..................................... ............... ................. ........................................................ .................................... .................................. ................................. Software ID Es for developing Web servers Database Tools for deploying servers How to structure with the MVC patt'ern Two patterns The Model 1 pattern The Model 2 (MVC) pattern and files ................................................................................. 12 12 12 12 14 14 16 18 20 20 22 22 24 30 30 32 50 50 52 56 58 60 that uses the MVC pattern application .................... .................................................... A servlet/JSP The user interface The HTML for the first page ........................................................................................ The CS S for both web pages ....... The servlet The web.xml The User class ........................ The JSP for the second page ......................................................................................... ..................................... .................................... .................................... .................................. .................................. .................................. .................................................. ................. ................. ................................. 34 34 36 38 40 42 44 46 ................................ ................... file .................... for the back-end processing Chapter 3 How to use NetBeans and Tomcat How to get started How to start NetBeans How to create How to use the Projects How to open and close How to build, deploy, with NetBeans .................................................. ............ ...................................................................................... a new web application ........................................................................... window .................................................. projects ..................................... ................................. ............................................... and run a web application ......................................................... How to work with HTML and JS P files ............................................ How to add an HTML or JSP' file ................................................................................. How to edit an HTML or JSP file ..................... .................................... ........................ 62 62 64
••• VI 11 Expanded contents How to work with Java files ............................................................. How to add a Java class ...................... How to add a servlet. How to edit a Java file 66 66 ............................ 68 70 ......................................................................... .......................................................................... ................................................ ........................... ......................... How to work with XML files .............................................................. How to edit the web.xml file .............. How to edit other XML files ................................................ ............................................... ........................... .............................. 72 72 72 ............ for working with web files to a project. Other skills How to add existing How to deploy How to work with a web application server How to add a class library How to register a database or a JAR file to a project connection applications ................. 74 74 74 76 78 80 ............................. ................................ .......................... a web application to a remote server .................................................... .................................................................. ................................................ ....................... ........ ..................... ......................... Section 2 Essential servlet and JSP skills Chapter 4 A crash course in HTMLS and CSS3 the HTML5 semantic How to work with HTML ................................................................... The starting HTML for a web page ................................................... How to code HTML elements .................................................. How to use How to use the div and span elements with HTML5 ................................................... How to ensure cross-browser How to code links ........................... How to include How to code tables ........ ......................................................... ................................ ................... elements ................................................................. ................................................................. ............................................................... ....................................... .................................... ........................... 90 90 92 94 96 98 ..................... images ............ 100 102 104 ............... compatibility ........ CS S styles for an HTML page ................................... .................................................................... How to work with CSS How to provide How to code the basic CS S selectors How to codeCSS rule sets and comments ................................................................. How to use CS S to format a table ............................................................................... .......................................................................... 106 106 108 110 112 ....................... How to code HTML forms .................................................... How to code a form .......................... How to code text boxes .................... How to code buttons How to code check boxes and radio buttons How to code combo boxes and list boxes ................................................................... ......................................... ................................................ ............................................................... ........... ............... 114 114 116 118 120 122 ........................... ................... ................................................................................................... Chapter 5 How to develop servlets How to create and map a servlet How to create How to map a servlet How to map a servlet .................. with the web.xml with an annotation a servlet .... 128 128 130 132 ................................................. ............................. ............................. file .................................. ................................................................... ................................. .............. a servlet How to request How to use the HTTP GET method How to use the HTTP POST method ......................................................................... When to use ............................................................ ........................................................................... ...................................................... .... 134 134 136 136 the HTTP GET and POST methods for working with servlets ..................................................... Skills How to get the values How to get the of the parameters ...................................... ................... real path for a file .......... ........................ ..................... ........ ........ 138 ............ 138 140 ........
分享到:
收藏