You are previewing Java EE 5 Development with NetBeans 6.
O'Reilly logo
Java EE 5 Development with NetBeans 6

Book Description

Develop professional enterprise Java EE applications quickly and easily with this popular IDE

  • Use features of the popular NetBeans IDE to improve Java EE development

  • Careful instructions and screenshots lead you through the options available

  • Covers the major Java EE APIs such as JSF, EJB 3 and JPA, and how to work with them in NetBeans

  • Covers the NetBeans Visual Web designer in detail

In Detail

Java EE, the successor to J2EE, greatly simplifies the development of enterprise applications. The popular IDE, NetBeans, has several features that greatly simplify Java EE development, and this book shows you how to make use of these features to make your Java programming more efficient and productive than ever before.

With many features and great flexibility, the Java developer can become overwhelmed by the options available in NetBeans, This book helps you get control of the environment, and make it work for you so that you can concentrate on the important parts of your application.

This book takes you through the most important parts of Java EE programming and, with clear, careful instructions and screenshots, shows you how to use the features of NetBeans that will improve your development experience. This book will not only show you time-saving tricks, keyboard shortcuts and other productivity enhancements possible with NetBeans, it will take you through the major Java EE APIs and how to get them working in the NetBeans environment.

While focusing on NetBeans features, you will learn about developing applications using the servlet API and JSPs, including taking advantage of JSTL and developing custom JSP tags. Developing applications that take advantage of JavaServer Faces is also covered in detail, including how to generate standard JSF applications from an existing database schema. The book also covers how to easily develop elegant JSF applications by taking advantage of the NetBeans Visual Web designer.

Table of Contents

  1. Java EE 5 Development with NetBeans 6
  2. Credits
  3. About the Author
  4. About the Reviewers
  5. Preface
    1. What This Book Covers
    2. Who is This Book For
    3. Conventions
    4. Reader Feedback
    5. Customer Support
      1. Downloading the Example Code for the Book
      2. Errata
      3. Piracy
      4. Questions
  6. 1. Getting Started with NetBeans
    1. Introduction
    2. Downloading NetBeans
    3. Installing NetBeans
      1. Microsoft Windows
      2. Mac OS X
      3. Linux and Solaris
      4. Other Platforms
      5. Installation Procedure
    4. Starting NetBeans for the First Time
    5. Configuring NetBeans for Java EE Development
      1. Integrating NetBeans with a Third Party Application Server
      2. Integrating NetBeans with a Third Party RDBMS
        1. Adding a JDBC Driver to NetBeans
        2. Connecting to a Third Party RDBMS
    6. Deploying Our First Application
    7. NetBeans Tips for Effective Development
      1. Code Completion
      2. Code Templates
      3. Keyboard Shortcuts
      4. Understanding NetBeans Visual Cues
    8. Summary
  7. 2. Developing Web Applications with Servlets and JSPs
    1. Creating Our First Web Application
      1. Modifying NetBeans' Generated Code
        1. Developing the Input Page
        2. Developing the Output Page
    2. Servlet Development
      1. Adding a Servlet to Our Application
    3. Securing Web Applications
      1. Implementing Form Based Authentication
        1. Implementing the Login Page
        2. Implementing a Login Error Page
        3. Configuring Our Application for Form-Based Authentication
          1. GlassFish-Specific Security Configuration
    4. JSP Fragments
      1. Creating a JSP Fragment in NetBeans
    5. Monitoring Web Applications with NetBeans HTTP Monitor
    6. Summary
  8. 3. Enhancing JSP Functionality with JSTL and Custom Tags
    1. Core JSTL Tags
      1. Conditionally Displaying Part of a Page with the <c:if> Tag
      2. Displaying Mutually Exclusive Markup with the <c:choose> Tag
      3. Iterating through Arrays or Collections with the <c:forEach> Tag
    2. SQL JSTL Tags
      1. Retrieving Database Data with the <sql:query> Tag
      2. Modifying Database Data with the <sql:update> Tag
        1. Inserting Database Data
        2. Updating Database Data
        3. Deleting Database Data
    3. Closing Remarks about JSTL
    4. Custom JSP Tags
    5. Summary
  9. 4. Developing Web Applications using JavaServer Faces
    1. Introduction to JavaServer Faces
    2. Developing Our first JSF Application
      1. Creating a New JSF Project
        1. Modifying Our JSP to Capture User Data
        2. Creating Our Managed Bean
        3. Implementing Navigation
        4. Executing Our Application
    3. JSF Validation
    4. Displaying Tabular Data
    5. Summary
  10. 5. Interacting with Databases through the Java Persistence API
    1. Creating Our First JPA Entity
      1. Adding Persistent Fields to Our Entity
      2. Creating a Data Access Object (DAO)
      3. Generating the User Interface
      4. Implementing the Controller
      5. Trying Out Our Application
    2. Automated Generation of JPA Entities
      1. Named Queries and JPQL
      2. Entity Relationships
    3. Generating JSF Applications from JPA Entities
    4. Summary
  11. 6. Visual Web JSF Development
    1. Writing Our first Visual Web Application
      1. Adding Additional Components to Our Application
        1. Adding Additional Text Fields
        2. Adding a Drop-Down List Component
        3. Adding a Message Component to Each Input Field
        4. Grouping Error Messages with the Message Group Component
        5. Ajax Autovalidation
        6. Organizing Our Page into Tabs
        7. Binding a Drop-Down List to a Database Table
        8. Ajax-Enabling Visual Web Applications
    2. Summary
  12. 7. Implementing the Business Tier with Session Beans
    1. Introduction to Session Beans
    2. Creating a Session Bean in NetBeans
        1. Accessing the Bean from a Client
        2. Executing the Client
    3. Session Bean Transaction Management
    4. Implementing Aspect-Oriented Programming with Interceptors
      1. Implementing the Interceptor Class
      2. Decorating the EJB with the @Interceptors Annotations
    5. EJB Timer Service
      1. Implementing the Client
    6. Generating Session Beans from JPA Entities
    7. Summary
  13. 8. Messaging with JMS and Message Driven Beans
    1. Introduction to JMS
    2. Creating the Project and JMS Resources
      1. Creating a JMS Destination
    3. Sending Messages to a Message Destination
    4. Processing JMS Messages with Message Driven Beans
    5. Summary
  14. 9. Web Services
    1. Introduction to Web Services
    2. Creating a Simple Web Service
      1. Testing Our Web Service
      2. Developing a Client for Our Web Service
    3. Exposing EJBs as Web Services
      1. Implementing New Web Services as EJBs
      2. Exposing Existing EJBs as Web Services
      3. Creating a Web Service from an Existing WSDL
    4. Summary
  15. 10. Putting it all Together
    1. Creating Our Enterprise Project
      1. Implementing the Data Access Layer
      2. Implementing the User Interface Layer
        1. Adding User Interface Components to the Page
        2. Populating the Table
        3. Testing Our Application
        4. Adding Missing Functionality
        5. Defining Navigation Rules
        6. Testing the Completed Application
    2. Summary
  16. A. Debugging Enterprise Applications with the NetBeans Debugger
    1. Debugging Enterprise Applications
    2. Summary
  17. B. Identifying Performance Issues with NetBeans Profiler
    1. Profiling Our Application
    2. Summary