Book description
Java EE 7 Recipes takes an example-based approach in showing how to program Enterprise Java applications in many different scenarios. Be it a small-business web application, or an enterprise database application, Java EE 7 Recipes provides effective and proven solutions to accomplish just about any task that you may encounter. You can feel confident using the reliable solutions that are demonstrated in this book in your personal or corporate environment.
The solutions in Java EE 7 Recipes are built using the most current Java Enterprise specifications, including EJB 3.2, JSF 2.2, Expression Language 3.0, Servlet 3.1, and JMS 2.0. While older technologies and frameworks exist, it is important to be forward-looking and take advantage of all that the latest technologies offer. Rejuvenate your Java expertise to use the freshest capabilities, or perhaps learn Java Enterprise development for the first time and discover one of the most widely used and most powerful platforms available for application development today. Let Java EE 7 Recipes show you the way by showing how to build streamlined and reliable applications much faster and easier than ever before by making effective use of the latest frameworks and features on offer in the Java EE 7 release.
Shows off the most current Java Enterprise Edition technologies.
Provides solutions to creating sophisticated user interfaces.
Demonstrates proven solutions for effective database access.
Table of contents
- Title Page
- Dedication
- Contents at a Glance
- Contents
- About the Author
- About the Technical Reviewers
- Acknowledgments
- Introduction
-
CHAPTER 1: Introduction to Servlets
- 1-1. Setting Up a Java Enterprise Environment
- 1-2. Developing a Servlet
- 1-3. Packaging, Compiling, and Deploying a Servlet
- 1-4. Registering Servlets Without WEB-XML
- 1-5. Displaying Dynamic Content with a Servlet
- 1-6. Handling Requests and Responses
- 1-7. Listening for Servlet Container Events
- 1-8. Setting Initialization Parameters
- 1-9. Filtering Web Requests
- 1-10. Listening for Attribute Changes
- 1-11. Applying a Listener to a Session
- 1-12. Managing Session Attributes
- 1-13. Downloading a File
- 1-14. Dispatching Requests
- 1-15. Redirecting to a Different Site
- 1-16. Securely Maintaining State Within the Browser
- 1-17. Finalizing Servlet Tasks
- 1-18. Reading and Writing with Nonblocking I/O
-
CHAPTER 2: JavaServer Pages
- 2-1. Creating a Simple JSP Page
- 2-2. Embedding Java into a JSP Page
- 2-3. Separating Business Logic from View Code
- 2-4. Yielding or Setting Values
- 2-5. Invoking a Function in a Conditional Expression
- 2-6. Creating a JSP Document
- 2-7. Embedding Expressions in EL
- 2-8. Accessing Parameters in Multiple Pages
- 2-9. Creating a Custom JSP Tag
- 2-10. Including Other JSPs into a Page
- 2-11. Creating an Input Form for a Database Record
- 2-12. Looping Through Database Records Within a Page
- 2-13. Handling JSP Errors
- 2-14. Disabling Scriptlets in Pages
- 2-15. Ignoring EL in Pages
-
CHAPTER 3: The Basics of JavaServer Faces
- 3-1. Writing a Simple JSF Application
- 3-2. Writing a Managed Bean
- 3-3. Building Sophisticated JSF Views with Components
- 3-4. Displaying Messages in JSF Pages
- 3-5. Navigation Based Upon Conditions
- 3-6. Updating Messages Without Recompiling
- 3-7. Validating User Input
- 3-8. Evaluation of Page Expressions Immediately
- 3-9. Passing Page Parameters to Methods
- 3-10. Arithmetic and Reserved Words in Expressions
- 3-11. Creating Bookmarkable URLs
- 3-12. Displaying Lists of Objects
- 3-13. Invoking Managed Bean Actions on Life-Cycle Phase Events
-
CHAPTER 4: Facelets
- 4-1. Creating a Page Template
- 4-2. Applying a Template to Your Views
- 4-3. Ensuring Resource Availability from All Views
- 4-4. Creating Reusable Templates That Act As Components
- 4-5. Handling Variable-Length Data on a Page
- 4-6. Debugging View Content
- 4-7. Writing a Custom Resolver for Locating Facelets Templates and Resources
-
CHAPTER 5: JavaServer Faces Standard Components
- Component and Tag Primer
- 5-1. Creating an Input Form
- 5-2. Invoking Actions from Within a Page
- 5-3. Displaying Output
- 5-4. Adding Form Validation
- 5-5. Adding Select Lists to Pages
- 5-6. Adding Graphics to Your Pages
- 5-7. Adding Check Boxes to a View
- 5-8. Adding Radio Buttons to a View
- 5-9. Structuring View Layout
- 5-10. Displaying a Collection of Data
- 5-11. Utilizing Custom JSF Component Libraries
- 5-12. Implementing File Uploading
-
CHAPTER 6: Advanced JavaServer Faces and Ajax
- 6-1. Validating Input with Ajax
- 6-2. Submitting Pages Without Page Reloads
- 6-3. Making Partial-Page Updates
- 6-4. Applying Ajax Functionality to a Group of Components
- 6-5. Custom Processing of Ajax Functionality
- 6-6. Custom Conversion of Input Values
- 6-7. Maintaining Managed Bean Scopes for a Session
- 6-8. Listening for System-Level Events
- 6-9. Listening for Component Events
- 6-10. Invoking a Managed Bean Action on Render
- 6-11. Asynchronously Updating Components
- 6-12. Developing JSF Components Containing HTML5
- 6-13. Listening to JSF Phases
- 6-14. Adding Autocompletion to Text Fields
- 6-15. Developing Custom Constraint Annotations
- 6-16. Customizing Data Tables
- 6-17. Developing a Page Flow
- 6-18. Constructing a JSF View in Pure HTML5
-
CHAPTER 7: JDBC
- 7-1. Obtaining Database Drivers and Adding Them to the CLASSPATH
- 7-2. Connecting to a Database
- 7-3. Handling Database Connection Exceptions
- 7-4. Simplifying Connection Management
- 7-5. Querying a Database
- 7-6. Performing CRUD Operations
- 7-7. Preventing SQL Injection
- 7-8. Utilizing Java Objects for Database Access
- 7-9. Displaying Database Results in JSF Views
- 7-10. Navigating Data with Scrollable ResultSets
- 7-11. Calling PL/SQL Stored Procedures
- 7-12. Querying and Storing Large Objects
- 7-13. Caching Data for Use When Disconnected
- 7-14. Joining RowSet Objects When Not Connected to the Data Source
-
CHAPTER 8: Object-Relational Mapping
- 8-1. Creating an Entity
- 8-2. Mapping Data Types
- 8-3. Creating a Persistence Unit
- 8-4. Using Database Sequences to Create Primary Key Values
- 8-5. Generating Primary Keys with More Than One Attribute
- 8-6. Defining a One-to-One Relationship
- 8-7. Defining One-to-Many and Many-to-One Relationships
- 8-8. Defining a Many-to-Many Relationship
- 8-9. Querying with Named Queries
- 8-10. Performing Validation on Entity Fields
- 8-11. Generating Database Schema Objects Automatically
-
CHAPTER 9: Enterprise JavaBeans
- 9-1. Obtaining an Entity Manager
- 9-2. Developing a Stateless Session Bean
- 9-3. Developing a Stateful Session Bean
- 9-4. Utilizing Session Beans with JSF
- 9-5. Persisting an Object
- 9-6. Updating an Object
- 9-7. Returning a Table Model
- 9-8. Creating a Singleton Bean
- 9-9. Scheduling a Timer Service
- 9-10. Performing Optional Transaction Life-Cycle Callbacks
- 9-11. Ensuring a Stateful Session Bean Is Not Passivated
- 9-12. Denoting Local and Remote Interfaces
- 9-13. Processing Messages Asynchronously from Enterprise Beans
-
CHAPTER 10: The Query API and JPQL
- 10-1. Querying All Instances of an Entity
- 10-2. Setting Parameters to Filter Query Results
- 10-3. Returning a Single Object
- 10-4. Creating Native Queries
- 10-5. Querying More Than One Entity
- 10-6. Calling JPQL Aggregate Functions
- 10-7. Invoking Database Stored Procedures Natively
- 10-8. Joining to Retrieve Instances Matching All Cases
- 10-9. Joining to Retrieve All Rows Regardless of Match
- 10-10. Applying JPQL Functional Expressions
- 10-11. Forcing Query Execution Rather Than Cache Use
- 10-12. Performing Bulk Updates and Deletes
- 10-13. Retrieving Entity Subclasses
- 10-14. Joining with ON Conditions
- CHAPTER 11: Oracle's GlassFish
-
CHAPTER 12: Contexts and Dependency Injection
- 12-1. Injecting a Bean or Other Object
- 12-2. Binding a Bean to JSF Views
- 12-3. Allocating a Specific Bean for Injection
- 12-4. Determining Scope of a Bean
- 12-5. Injecting Non-bean Objects
- 12-6. Ignoring Classes
- 12-7. Disposing of Producer Fields
- 12-8. Specifying an Alternative Implementation at Deployment Time
- 12-9. Injecting Bean Metadata
- CHAPTER 13: Java Message Service
-
CHAPTER 14: Authentication and Security
- 14-1. Setting Up Application Users and Groups in GlassFish
- 14-2. Performing Basic Web Application Authentication
- 14-3. Developing a Programmatic Login Form
- 14-4. Managing Page Access Within a JSF Application
- 14-5. Configuring LDAP Authentication Within GlassFish
- 14-6. Configuring Custom Security Certificates Within GlassFish
-
CHAPTER 15: Java Web Services
- 15-1. Creating a JAX-WS Web Service Endpoint
- 15-2. Deploying a JAX-WS Web Service
- 15-3. Consuming a JAX-WS Web Service via WSDL
- 15-4. Consuming a JAX-WS Web Service via a Stand-Alone Application Client
- 15-5. Integrating Web Services into a Java EE Project
- 15-6. Developing a RESTful Web Service
- 15-7. Consuming and Producing with REST
- 15-8. Writing a JAX-RS Client
- 15-9. Filtering Requests and Responses
- 15-10. Processing Long-Running Operations Asynchronously
- CHAPTER 16: Enterprise Solutions Using Alternative Programming Languages
- CHAPTER 17: WebSockets and JSON-P
- CHAPTER 18: JavaFX in the Enterprise
-
CHAPTER 19: Concurrency and Batch Applications
- 19-1. Creating Resources for Processing Tasks Asynchronously in an Application Server
- 19-2. Configuring and Creating a Reporter Task
- 19-3. Running More Than One Task Concurrently
- 19-4. Utilizing Transactions Within a Task
- 19-5. Running Concurrent Tasks at Scheduled Times
- 19-6. Creating Thread Instances
- 19-7. Creating an Item-Oriented Batch Process
- APPENDIX A: Java EE Development with NetBeans IDE
- Index
Product information
- Title: Java EE 7 Recipes: A Problem-Solution Approach
- Author(s):
- Release date: May 2013
- Publisher(s): Apress
- ISBN: 9781430244257
You might also like
book
Mastering Java EE Development with WildFly
Your one stop solution to create highly scalable enterprise grade Java applications with WildFly. About This …
book
Java EE 7 Essentials
Get up to speed on the principal technologies in the Java Platform, Enterprise Edition 7, and …
book
Java EE 8 Recipes: A Problem-Solution Approach
Quickly find solutions to dozens of common programming problems with the Java Enterprise Edition Platform for …
book
Java 9 Recipes: A Problem-Solution Approach, Third Edition
Quickly find solutions to dozens of common programming problems encountered while building Java applications. Content is …