e17455

of 998 /998
Oracle® Fusion Middleware User's Guide for Oracle JDeveloper 11g Release 2 (11.1.2.1.0) E17455-02 September 2011

Author: samcarte

Post on 01-Nov-2014

34 views

Category:

Documents


2 download

Embed Size (px)

TRANSCRIPT

Oracle Fusion MiddlewareUser's Guide for Oracle JDeveloper 11g Release 2 (11.1.2.1.0)E17455-02

September 2011

Oracle Fusion Middleware User's Guide for Oracle JDeveloper 11g Release 2 (11.1.2.1.0) E17455-02 Copyright 2011 Oracle and/or its affiliates. All rights reserved. Primary Author: Catherine Pickersgill, David Mathews, Deepanjan Dey, Penny Anderson, Scott Fisher, Elizabeth Lynch, Ben Gelernter, Robin Merrin This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited. The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing. If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, the following notice is applicable: U.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical data delivered to U.S. Government customers are "commercial computer software" or "commercial technical data" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, duplication, disclosure, modification, and adaptation shall be subject to the restrictions and license terms set forth in the applicable Government contract, and, to the extent applicable by the terms of the Government contract, the additional rights set forth in FAR 52.227-19, Commercial Computer Software License (December 2007). Oracle America, Inc., 500 Oracle Parkway, Redwood City, CA 94065. This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group. This software or hardware and documentation may provide access to or information on content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services.

ContentsPreface ................................................................................................................................................................ xliAudience...................................................................................................................................................... xli Documentation Accessibility .................................................................................................................... xli Related Documents .................................................................................................................................... xli Conventions ............................................................................................................................................... xlii

What's New in This Guide in Release 11.1.2.1.0 ..................................................................... xliii Part I Getting Started with Oracle JDeveloper

1 Introduction to Oracle JDeveloper1.1 1.2 1.3 About Oracle JDeveloper ........................................................................................................... 1-1 Oracle JDeveloper Information Resources .............................................................................. 1-2 Migrating to Oracle JDeveloper 11g......................................................................................... 1-2

2 Oracle JDeveloper Accessibility Information2.1 About Oracle JDeveloper Accessibility.................................................................................... 2-1 2.2 Using a Screen Reader and Java Access Bridge with Oracle JDeveloper ........................... 2-1 2.3 Oracle JDeveloper Features That Support Accessibility ....................................................... 2-1 2.3.1 Keyboard Access.................................................................................................................. 2-1 2.3.2 Screen Reader Readability.................................................................................................. 2-3 2.3.3 Flexibility in Font and Color Choices ............................................................................... 2-3 2.3.4 No Audio-only Feedback ................................................................................................... 2-3 2.3.5 No Dependency on Blinking Cursor and Animation..................................................... 2-3 2.3.6 Screen Magnifier Usability ................................................................................................. 2-3 2.3.7 How to Change the Editor or Tabbed View of a File ..................................................... 2-4 2.3.8 How to Read Text in a Multi-line Edit Field.................................................................... 2-4 2.3.9 How to Read the Line Number in the Source Editor ..................................................... 2-4 2.3.10 How to Access Exception Stack HTML Links and Generated Javadoc Links in the Log Window 2-4 2.4 Recommendations for Customizing Oracle JDeveloper ....................................................... 2-4 2.4.1 How to Customize the Accelerators Keys........................................................................ 2-4 2.4.2 How to Pass a Conflicting Accelerator Key to Oracle JDeveloper ............................... 2-4 2.4.3 How to Change the Look and Feel of the IDE................................................................. 2-5 2.4.4 How to Customize the Fonts in Editors ........................................................................... 2-5iii

2.4.5 2.4.6 2.4.7 2.4.8 2.5

How to Customize Syntax Highlighting .......................................................................... How to Display Line Numbers in Editors ....................................................................... How to Change the Timing for Code Insight .................................................................. How to Specify the Columns in the Debugger................................................................ Highly Visual Features of Oracle JDeveloper.........................................................................

2-5 2-5 2-5 2-5 2-5

3 Working with Oracle JDeveloper3.1 About Working with Oracle JDeveloper ................................................................................. 3-1 3.2 Working with JDeveloper Roles ............................................................................................... 3-1 3.2.1 How to Change the JDeveloper Role ................................................................................ 3-2 3.3 How to Manage JDeveloper Features ...................................................................................... 3-2 3.4 Working With Windows In the IDE......................................................................................... 3-3 3.4.1 How to Maximize Windows .............................................................................................. 3-3 3.4.2 How to Minimize and Restore Dockable Windows in the IDE .................................... 3-3 3.4.3 How to Dock Windows in the IDE.................................................................................... 3-3 3.4.4 About Dockable Windows in the IDE .............................................................................. 3-4 3.4.5 How to Close and Reopen Dockable Windows in the IDE ........................................... 3-4 3.4.6 How to Restore Window Layout to Factory Settings..................................................... 3-4 3.5 Navigating The IDE.................................................................................................................... 3-5 3.5.1 How to Work With Shortcut Keys In The IDE ................................................................ 3-5 3.5.2 Keyboard Navigation In JDeveloper ................................................................................ 3-6 3.5.2.1 Common Navigation Keys.......................................................................................... 3-6 3.5.2.2 Navigation In Standard Components........................................................................ 3-7 3.5.2.3 Navigating Complex Controls................................................................................. 3-12 3.5.2.4 Navigation in Specific Components ....................................................................... 3-17 3.6 Customizing the IDE ............................................................................................................... 3-21 3.6.1 How to Change the Look and Feel of the IDE.............................................................. 3-21 3.6.2 How to Customize the General Environment for the IDE ......................................... 3-22 3.6.3 How to Customize Dockable Windows in the IDE ..................................................... 3-22 3.6.4 How to Customize the Compare Window in the IDE................................................. 3-23 3.6.5 How to Customize the Component Palette .................................................................. 3-23 3.6.5.1 How to Add a Page to the Palette ........................................................................... 3-23 3.6.5.2 How to Add a JavaBeans Component to the Palette............................................ 3-23 3.6.5.3 How to Add a Code Snippet to the Palette............................................................ 3-24 3.6.5.4 How to Remove a Page from the Palette ............................................................... 3-25 3.6.5.5 How to Remove a Component from the Palette ................................................... 3-25 3.6.6 How to Change Roles in JDeveloper ............................................................................. 3-26 3.6.7 How to Associate File Types with JDeveloper ............................................................. 3-26 3.7 Working with the Resource Palette ....................................................................................... 3-26 3.7.1 How to Open the Resource Palette ................................................................................ 3-27 3.7.2 How to Work With IDE Connections ............................................................................ 3-27 3.7.2.1 Resource Palette Connection Descriptor Properties Location ............................ 3-28 3.7.2.2 Defining the Scope of a Connection........................................................................ 3-28 3.7.2.2.1 Application Resource Connections.................................................................. 3-28 3.7.2.2.2 IDE Connections ................................................................................................. 3-28 3.7.2.3 How to Create IDE Connections ............................................................................. 3-28 3.7.2.4 How to Edit IDE Connections ................................................................................. 3-28

iv

3.7.2.5 How to Add IDE Connections to Applications..................................................... 3-29 3.7.3 How to Search the Resource Palette............................................................................... 3-29 3.7.3.1 Performing a simple search...................................................................................... 3-29 3.7.3.2 Performing an advanced search .............................................................................. 3-29 3.7.4 How to Reuse Resource Palette Searches...................................................................... 3-30 3.7.5 How to Filter Resource Palette Contents....................................................................... 3-30 3.7.6 How to Import and Export Catalogs and Connections............................................... 3-30 3.7.7 How to Refresh the Resource Palette............................................................................. 3-31 3.7.8 How to Work With Resource Palette Catalogs............................................................. 3-31 3.7.8.1 How to Create Catalogs............................................................................................ 3-31 3.7.8.2 How to Rename Catalogs ......................................................................................... 3-32 3.7.9 How to Work with Catalog Folders ............................................................................... 3-32 3.7.9.1 How to Create Folders .............................................................................................. 3-32 3.7.9.2 How to Create Dynamic Folders............................................................................. 3-32 3.7.9.3 How to Add Resources to a Catalog....................................................................... 3-32 3.8 Working with Source Files ..................................................................................................... 3-33 3.8.1 Using the Source Editor ................................................................................................... 3-33 3.8.1.1 Features Available From the Context Menu.......................................................... 3-35 3.8.2 How to Set Preferences for the Source Editor............................................................... 3-36 3.8.3 How to Customize Code Templates for the Source Editor ........................................ 3-38 3.8.4 How to Manage Source Files in the Editor Window ................................................... 3-40 3.8.4.1 Maximizing the View of a File................................................................................. 3-40 3.8.4.2 Navigating Between Open Files in the Editor Window ...................................... 3-40 3.8.4.3 How to Display the List of All Currently Open Files........................................... 3-41 3.8.4.4 How to Access a Recently Opened File.................................................................. 3-41 3.8.4.5 How to Open Multiple Editors for a File ............................................................... 3-41 3.8.4.6 Viewing More Than One File at a Time ................................................................. 3-42 3.8.4.7 How to Quickly Close Files in the Editor Window .............................................. 3-42 3.8.5 Working with Mouseover Popups ................................................................................. 3-43 3.8.6 How to Locate a Source Node in the Navigator .......................................................... 3-44 3.8.7 How to Set Bookmarks in Source Files .......................................................................... 3-44 3.8.8 How to Edit Source Files ................................................................................................. 3-44 3.8.8.1 How to Open Source Files in the Source Editor.................................................... 3-44 3.8.8.2 How to Edit Source Code with an External Editor............................................... 3-45 3.8.8.3 How to Insert a Code Snippet from the Component Palette into Source Files 3-45 3.8.8.4 How to Record and Play Back Macros in Source Files ........................................ 3-46 3.8.8.5 How to Create Tasks ................................................................................................. 3-46 3.8.9 How to Compare Source Files ........................................................................................ 3-47 3.8.10 How to Revert to the Last Saved Version of a File ...................................................... 3-47 3.8.11 How to Search Source Files ............................................................................................. 3-48 3.8.12 How to Print Source Files ................................................................................................ 3-49 3.8.13 Reference: Regular Search Expressions ......................................................................... 3-49 3.9 Working with Extensions........................................................................................................ 3-49 3.9.1 How to Install Extensions with Check for Updates..................................................... 3-50 3.9.2 How to Install Extensions from the Provider's Web Site ............................................ 3-50 3.9.3 How to Install Extensions Directly from OTN ............................................................. 3-50 3.9.4 How to Install Extensions Using the JDeveloper dropins Directory ........................ 3-51

v

3.10 Using the Online Help............................................................................................................. 3.10.1 Using the Help Center...................................................................................................... 3.10.2 How to Open the Online Help........................................................................................ 3.10.3 How to Search the Documentation ................................................................................ 3.10.4 How to Add Bookmarks to the Favorites Page ............................................................ 3.10.5 How to Customize the Online Help Display................................................................ 3.10.6 How to Open and Close Multiple Help Topics............................................................ 3.10.7 How to Print Help Topics................................................................................................ 3.11 Common Development Tools ................................................................................................ 3.11.1 Application Overview...................................................................................................... 3.11.1.1 Checklist...................................................................................................................... 3.11.1.2 File Summary Pages ................................................................................................. 3.11.2 File List ............................................................................................................................... 3.11.2.1 File List Tab Header .................................................................................................. 3.11.2.2 Search Criteria Area .................................................................................................. 3.11.2.3 Search Results Table.................................................................................................. 3.11.3 Compare Window ............................................................................................................ 3.11.3.1 Toolbar ........................................................................................................................ 3.11.3.2 Source and Target Areas .......................................................................................... 3.11.4 Application Navigator ..................................................................................................... 3.11.4.1 Application Navigator Toolbar ............................................................................... 3.11.4.2 Application Operations ............................................................................................ 3.11.4.3 Projects Panel Operations......................................................................................... 3.11.4.4 Application Resources Panel Operations............................................................... 3.11.4.5 Data Controls Panel Operations.............................................................................. 3.11.4.6 Recently Opened Files Panel Operations ............................................................... 3.11.5 Application Server Navigator......................................................................................... 3.11.6 Structure Window ........................................................................................................... 3.11.6.1 Structure Window Toolbar ...................................................................................... 3.11.6.2 Structure Window Views ......................................................................................... 3.11.7 Application Navigator - Data Controls Panel .............................................................. 3.11.8 Log Window ...................................................................................................................... 3.11.9 Status Window .................................................................................................................. 3.11.10 Tasks Window................................................................................................................... 3.12 Adding External Tools to JDeveloper ...................................................................................

3-51 3-51 3-52 3-52 3-53 3-54 3-55 3-55 3-56 3-56 3-56 3-57 3-58 3-58 3-58 3-59 3-59 3-60 3-60 3-60 3-60 3-61 3-61 3-62 3-62 3-63 3-63 3-64 3-64 3-65 3-65 3-66 3-67 3-67 3-68

Part II Developing Applications with Oracle JDeveloper 4 Getting Started with Developing Applications with Oracle JDeveloper4.1 About Developing Applications with Oracle JDeveloper .................................................... 4-1

5 Working with Applications and Projects5.1 5.2 5.2.1 5.2.2 About Working with Applications and Projects .................................................................... Creating Applications and Projects.......................................................................................... How to Create an Application ........................................................................................... How to Create a Custom Application .............................................................................. 5-1 5-2 5-2 5-2

vi

5.2.3 How to Create a New Project............................................................................................. 5-2 5.2.3.1 How to Create a New Project ..................................................................................... 5-3 5.2.3.2 How to Create a New Custom Project....................................................................... 5-3 5.3 Managing Applications and Projects ....................................................................................... 5-3 5.3.1 How to Open an Existing Application or Project............................................................ 5-3 5.3.2 How to Import Existing Source Files into JDeveloper ................................................... 5-4 5.3.2.1 Importing Existing Files into a New JDeveloper Project ........................................ 5-4 5.3.2.2 How to Import a WAR File into a New JDeveloper Project................................... 5-5 5.3.2.3 Importing an EAR File into a New JDeveloper Application.................................. 5-5 5.3.3 How to Import Files into a Project .................................................................................... 5-6 5.3.3.1 How to Import Files into a Project ............................................................................. 5-6 5.3.4 How to Manage Folders and Java Packages in a Project ............................................... 5-7 5.3.5 How to Manage Working Sets ........................................................................................... 5-7 5.3.6 How to Browse Files in JDeveloper Without Adding Them to a Project .................... 5-9 5.3.7 How to View an Archive .................................................................................................... 5-9 5.3.8 How to View an Image File in JDeveloper....................................................................... 5-9 5.3.9 How to Set Default Project Properties ........................................................................... 5-10 5.3.10 How to Set Properties for Individual Projects.............................................................. 5-10 5.3.10.1 How to Include Libraries in a Project ..................................................................... 5-10 5.3.10.2 How to Remove Libraries from a Project............................................................... 5-12 5.3.10.3 How to Set the Target Java SE for a Project ........................................................... 5-12 5.3.10.4 How to Manage Project Dependencies .................................................................. 5-12 5.3.10.5 How to Associate Features with a Project.............................................................. 5-13 5.3.10.6 How to Set Javadoc Properties for a Project .......................................................... 5-13 5.3.11 How to Manage Application and Project Templates .................................................. 5-13 5.3.11.1 How to Define a New Application Template........................................................ 5-14 5.3.11.2 How to Define a New Project Template................................................................. 5-14 5.3.11.3 How to Share Application and Project Templates................................................ 5-14 5.3.11.4 How to Edit an Existing Application or Project Template .................................. 5-15 5.3.11.5 How to Delete an Existing Application or Project Template .............................. 5-15 5.4 Managing Application, Project, or Individual Files............................................................ 5-15 5.4.1 How to Save an Application or Project ......................................................................... 5-15 5.4.2 How to Save an Individual Component or File ........................................................... 5-16 5.4.3 How to Rename an Application, Project, or Individual Component........................ 5-16 5.4.4 How to Relocate an Application, Project, or Project Contents................................... 5-17 5.4.5 How to Close an Application, Project, or Other File ................................................... 5-18 5.4.6 How to Remove a File from a Project ............................................................................ 5-18 5.4.7 How to Remove a Project from an Application ........................................................... 5-18 5.4.8 How to Remove an Application ..................................................................................... 5-19 5.5 Managing Libraries and Java SEs Outside the Project Scope ............................................ 5-19 5.5.1 How to Import Libraries or Java SEs Outside the Project Scope ............................... 5-19 5.5.2 How to Create Libraries or Java SEs Outside the Project Scope ................................ 5-19 5.5.3 How to Edit Libraries or Java SEs Outside the Project Scope .................................... 5-20 5.5.4 How to Delete Libraries or Java SEs Outside the Project Scope ................................ 5-20

6 Versioning Applications with Source Control6.1 About Versioning Applications with Source Control ........................................................... 6-1

vii

6.2 Downloading Source Control Extensions in Oracle JDeveloper.......................................... 6-2 6.3 Using Subversion with Oracle JDeveloper.............................................................................. 6-2 6.3.1 How To Set Up Subversion and JDeveloper.................................................................... 6-3 6.3.1.1 How to Connect to a Subversion Repository Through a Proxy Server ................ 6-3 6.3.1.2 How to Check the Installation .................................................................................... 6-4 6.3.1.3 How to Create a Subversion Repository ................................................................... 6-4 6.3.1.4 How to Create or Edit a Subversion Connection..................................................... 6-5 6.3.1.5 How to View Subversion Repository Content ......................................................... 6-5 6.3.1.6 How to Check Out Files from the Subversion Repository ..................................... 6-6 6.3.1.7 How to Update Files from the Subversion Repository ........................................... 6-7 6.3.1.8 How to Import JDeveloper Files Into Subversion ................................................... 6-7 6.3.1.8.1 How to Import an Application to Subversion................................................... 6-8 6.3.2 How to Work with Files in Subversion ............................................................................ 6-8 6.3.2.1 How to Add a File to Subversion Control ................................................................ 6-8 6.3.2.2 How to Use Change Sets ............................................................................................. 6-9 6.3.2.2.1 Editing Change Sets ........................................................................................... 6-10 6.3.2.3 How to View the History of a File .......................................................................... 6-10 6.3.2.4 How to Commit Files to the Subversion Repository............................................ 6-10 6.3.2.4.1 Saving Work Item ID with the Oracle Team Productivity Center Extension....... 6-11 6.3.2.5 How to Use Templates in Subversion .................................................................... 6-11 6.3.2.6 How to Revert Files to their Previous State........................................................... 6-12 6.3.2.7 How to Replace a File with the Subversion Base Revision ................................. 6-12 6.3.2.8 How to Compare Files in Subversion..................................................................... 6-12 6.3.2.9 How to Resolve Conflicts in File Versions............................................................. 6-13 6.3.2.10 How to Resolve Conflicts in Subversion................................................................ 6-13 6.3.2.11 How to Resolve Property Conflicts in Subversion ............................................... 6-14 6.3.2.12 How to Use the Merge Wizard................................................................................ 6-14 6.3.2.13 How to Work with Branches and Tags .................................................................. 6-15 6.3.2.14 How to Add and View Subversion Properties...................................................... 6-16 6.3.2.14.1 Example of Subversion Properties................................................................... 6-16 6.3.2.14.2 Specifying a Revision Number with a Subversion External Property ....... 6-17 6.3.2.15 How to View the Status of a Subversion File ........................................................ 6-17 6.3.2.16 How to Refresh the Status of Files Under Subversion Control .......................... 6-18 6.3.2.17 How to Remove Files from Subversion Control ................................................... 6-18 6.3.3 How to Use Export Features .......................................................................................... 6-18 6.3.3.1 How to Create and Apply Patches.......................................................................... 6-18 6.3.3.2 How to Export Subversion Controlled Files from JDeveloper ........................... 6-19 6.3.3.3 How to Export and Import Subversion Repository Connection Details........... 6-20 6.4 Using Concurrent Version System (CVS) with Oracle JDeveloper .................................. 6-20 6.4.1 How to Set Up CVS with Oracle JDeveloper................................................................ 6-21 6.4.1.1 How to Configure JDeveloper for Use with CVS ................................................. 6-21 6.4.1.2 How to Create a CVS Connection ........................................................................... 6-22 6.4.1.3 How To Import JDeveloper Project Files Into CVS .............................................. 6-22 6.4.1.4 How to Check Out CVS Modules ........................................................................... 6-22 6.4.2 How to Configure CVS For Use with JDeveloper........................................................ 6-23 6.4.2.1 How to Create a Local CVS Repository ................................................................. 6-23 6.4.2.2 How to Configure SSH (Secure Shell), CVS and JDeveloper.............................. 6-23viii

6.4.2.2.1 Configuring for SSH Level 1 (SSH).................................................................. 6.4.2.2.2 Configuring for SSH Level 2 (SSH2)................................................................ 6.4.2.3 How to Choose a Character Set (Local Client Only) ............................................ 6.4.2.4 How to Log In to CVS............................................................................................... 6.4.2.5 How to Access Local Files with CVS ...................................................................... 6.4.2.5.1 Handling CVS File Types .................................................................................. 6.4.3 How to Use CVS After Configuration ........................................................................... 6.4.3.1 How to Update a Project, Folder, or File in CVS .................................................. 6.4.3.2 How to Edit and Watch Files in CVS...................................................................... 6.4.3.3 How to Commit Changes to CVS............................................................................ 6.4.3.4 How to Merge Files in CVS...................................................................................... 6.4.4 How to Work with Branches in CVS ............................................................................. 6.4.4.1 How to Create a New Branch .................................................................................. 6.4.4.2 How to Use Branches in CVS................................................................................... 6.4.4.2.1 How to Switch the Branch or Version ............................................................. 6.4.4.2.2 How to Choose a Branch while Updating ...................................................... 6.4.4.2.3 How to Choose a Branch While Checking Out.............................................. 6.4.4.3 How to use Tags in CVS ........................................................................................... 6.4.4.3.1 How to Add a Tag to a Project ......................................................................... 6.4.4.3.2 How to Apply Tags While Updating a Project or File .................................. 6.4.4.3.3 How to Delete a Tag........................................................................................... 6.4.5 How to Work with Files in CVS ..................................................................................... 6.4.5.1 How to Refresh the Display of CVS Objects.......................................................... 6.4.5.2 How to Add and Remove Files ............................................................................... 6.4.5.3 How to Use CVS Templates..................................................................................... 6.4.5.4 How to Compare Files in CVS................................................................................. 6.4.5.5 How to Replace a File with a CVS Revision .......................................................... 6.4.5.6 How to View the History and Status of a File....................................................... 6.4.5.7 How to Lock and Unlock Files ................................................................................ 6.4.5.8 How to Work with Revisions and Tags ................................................................. 6.4.6 How to Use External Tools and Export Features ......................................................... 6.4.6.1 How to Use an External Diff Tool with CVS ......................................................... 6.4.6.2 How to Export a CVS Module ................................................................................. 6.4.6.3 How to Copy the CVSROOT Path to the Clipboard ............................................ 6.4.7 How to Create and Apply Patches................................................................................. 6.5 Using Perforce with Oracle JDeveloper................................................................................ 6.5.1 How to Set Up Perforce with JDeveloper .................................................................... 6.5.1.1 How to Install Perforce Components for Use with JDeveloper.......................... 6.5.1.2 How to Configure JDeveloper for Use with Perforce .......................................... 6.5.1.3 How to Connect to Perforce..................................................................................... 6.5.1.4 How to Make Multiple Connections to Perforce .................................................. 6.5.1.5 How to Bring Files Under Perforce Control .......................................................... 6.5.1.6 How to Import JDeveloper Files Into Perforce...................................................... 6.5.2 How to Work with Files in Perforce ............................................................................. 6.5.2.1 How to Synchronize Local Files With the Controlled Versions ......................... 6.5.2.2 How to Synchronize Files With the Perforce Navigator...................................... 6.5.2.3 How to Filter Files By Perforce Workspace ...........................................................

6-23 6-24 6-24 6-25 6-25 6-26 6-26 6-26 6-27 6-28 6-29 6-30 6-30 6-30 6-30 6-31 6-31 6-31 6-32 6-32 6-32 6-32 6-33 6-33 6-34 6-35 6-35 6-36 6-36 6-37 6-38 6-38 6-40 6-40 6-40 6-41 6-41 6-41 6-42 6-43 6-43 6-44 6-45 6-45 6-45 6-46 6-47

ix

6.5.2.4 How to Edit Files ....................................................................................................... 6-47 6.5.2.5 How to Submit Changed Files to the Perforce Depot .......................................... 6-48 6.5.2.6 How to Resolve Conflicts in File Versions............................................................. 6-48 6.5.2.7 How to Resolve Conflicts in File Versions............................................................. 6-49 6.5.2.8 How to Refresh the Status of Files under Perforce Control ................................ 6-49 6.5.2.9 How to Delete Files ................................................................................................... 6-50 6.5.3 How to Work with Changelists ..................................................................................... 6-50 6.5.3.1 How to Create a Perforce Changelist...................................................................... 6-51 6.5.3.2 How to Annotate a Perforce Revision or Changelist ........................................... 6-51 6.5.3.3 How to Add Files to a Perforce Changelist ........................................................... 6-51 6.5.3.4 How to Submit a Perforce Changelist .................................................................... 6-51 6.5.3.5 How to Use the Changelist Browser....................................................................... 6-52 6.5.4 How to Create and Apply Patches................................................................................. 6-52 6.6 Using Serena Dimensions with Oracle JDeveloper............................................................. 6-53 6.6.1 How to Set Up Dimensions and JDeveloper ............................................................... 6-54 6.6.1.1 How to Connect to a Dimensions Repository ....................................................... 6-54 6.6.1.2 How to Disconnect from a Dimensions Repository ............................................. 6-54 6.6.1.3 How to Add Files to Dimensions Control ............................................................. 6-55 6.6.1.4 How to Remove Files from Dimensions Control.................................................. 6-55 6.6.1.5 How to Set the Current Project................................................................................ 6-55 6.6.2 How to Work with Files in Dimensions ....................................................................... 6-55 6.6.2.1 How to Import Files to Dimensions........................................................................ 6-56 6.6.2.2 Using Navigator Icon Overlays ............................................................................... 6-56 6.6.2.3 How to Download a Dimensions Project............................................................... 6-56 6.6.2.4 How to Check Out Files............................................................................................ 6-57 6.6.2.5 How to Undo a File Checkout ................................................................................. 6-58 6.6.2.6 How to Check In Files............................................................................................... 6-59 6.6.2.7 About the Pending Changes List............................................................................. 6-60 6.7 Using Rational ClearCase with Oracle JDeveloper............................................................. 6-60 6.7.1 How to Configure JDeveloper to Use Rational ClearCase ........................................ 6-60 6.7.2 How to Add a File to ClearCase .................................................................................... 6-61 6.7.3 How to Refresh the Status of Objects under ClearCase Control .............................. 6-61 6.7.4 How to Remove a File From ClearCase ........................................................................ 6-62 6.7.5 How to Check In a File to ClearCase ............................................................................ 6-62 6.7.6 How to Check Out a File From ClearCase ................................................................... 6-62 6.7.7 How to Undo a ClearCase Checkout ............................................................................ 6-63 6.7.8 How to List ClearCase Checkouts ................................................................................. 6-63 6.7.9 How to Compare Files Checked In to ClearCase ........................................................ 6-63 6.7.10 How to Display the History of a ClearCase File ......................................................... 6-64 6.7.11 How to Display the Description of a ClearCase File .................................................. 6-64 6.8 Using Team System with Oracle JDeveloper....................................................................... 6-64 6.8.1 How to Set Up Team System and JDeveloper.............................................................. 6-65 6.8.1.1 How to Set Up Team System for Use with JDeveloper........................................ 6-65 6.8.1.2 How to Configure JDeveloper for Use with Team System ................................. 6-65 6.8.2 How to Work with Files in Team System .................................................................... 6-66 6.8.2.1 How to Get Versions of Files from the Team System Server .............................. 6-67 6.8.2.2 How to Add FIles to Team System Control........................................................... 6-67

x

6.8.2.3 How to Check Out Files............................................................................................ 6.8.2.4 How to View the Status of a File ............................................................................. 6.8.2.5 How to Refresh the Status of Files .......................................................................... 6.8.2.6 How to Check In Files............................................................................................... 6.8.2.7 How to Resolve Conflicts in File Versions............................................................. 6.8.2.8 How to Undo Changes to Files................................................................................ 6.8.2.9 How to Replace a File with the Team System Base Version ............................... 6.8.2.10 How to View the History of a File .......................................................................... 6.8.2.11 How to Compare Files In Team System................................................................. 6.8.2.12 How to Shelve and Unshelve Files ......................................................................... 6.8.2.13 How to Delete Files ................................................................................................... 6.8.3 How to Use Import and Export Features ...................................................................... 6.8.3.1 How to Create Patches.............................................................................................. 6.8.3.2 How to Apply Patches .............................................................................................. 6.9 Using WebDAV with JDeveloper.......................................................................................... 6.9.1 WebDAV Server Requirements ...................................................................................... 6.9.2 How to Create a WebDAV Connection......................................................................... 6.9.3 How to Access a WebDAV-Enabled Server Via a Proxy Server................................ 6.9.4 How to Modify a WebDAV Connection ....................................................................... 6.9.5 How to Refresh a WebDAV Connection ....................................................................... 6.9.6 How to Delete a WebDAV Connection .........................................................................

6-67 6-68 6-68 6-68 6-69 6-69 6-69 6-69 6-69 6-70 6-71 6-71 6-71 6-72 6-72 6-72 6-73 6-73 6-74 6-74 6-74

7 Building, Running and Debugging Applications7.1 7.2 7.2.1 7.2.2 7.2.3 7.3 7.3.1 7.4 7.4.1 7.4.2 About Building, Running and Debugging Applications ...................................................... Building Applications ................................................................................................................ Make and Rebuild................................................................................................................ Apache Ant ........................................................................................................................... Apache Maven ..................................................................................................................... Running Applications ................................................................................................................ Run Manager ........................................................................................................................ Debugging Applications ............................................................................................................ How to Use the Debugger .................................................................................................. Technologies that Use Debugging .................................................................................... 7-1 7-1 7-2 7-2 7-2 7-2 7-2 7-2 7-3 7-3

8 Auditing and Profiling Applications8.1 8.2 8.3 8.3.1 8.3.2 8.3.3 8.3.4 8.3.5 8.3.6 8.3.7 8.3.8 About Auditing and Profiling Applications ........................................................................... Auditing Applications................................................................................................................ Monitoring HTTP Using the HTTP Analyzer......................................................................... How to Use the Log Window ............................................................................................ How to Use the Test Window............................................................................................ How to Use the Instances Window................................................................................... What Happens When You Run the HTTP Analyzer...................................................... How to Specify HTTP Analyzer Settings ......................................................................... How to Use Multiple Instances ......................................................................................... How to Configure External Web Browsers...................................................................... Using SSL .............................................................................................................................. 8-1 8-1 8-1 8-2 8-3 8-5 8-6 8-6 8-6 8-6 8-7

xi

8.3.8.1 HTTPS Keystore............................................................................................................ 8-7 8.3.8.2 Username Token........................................................................................................... 8-8 8.3.8.3 X509 Certificates ........................................................................................................... 8-8 8.3.8.4 STS Configuration ........................................................................................................ 8-8 8.3.8.5 How to Use HTTPS ...................................................................................................... 8-8 8.3.8.6 How to Configure Credentials for Testing Web Service Policies .......................... 8-8 8.3.9 How to Run the HTTP Analyzer ...................................................................................... 8-9 8.3.10 How to Debug Web Pages Using the HTTP Analyzer................................................... 8-9 8.3.11 How to Edit and Resend HTTP Requests .................................................................... 8-10 8.3.12 How to Use Rules to Determine Behavior .................................................................... 8-10 8.3.12.1 Using the Pass Through Rule................................................................................... 8-10 8.3.12.2 Using the Forward Rule ........................................................................................... 8-10 8.3.12.3 Using the URL Substitution Rule ............................................................................ 8-11 8.3.12.4 Using the Tape Rule .................................................................................................. 8-11 8.3.13 How to Set Rules............................................................................................................... 8-11 8.3.14 Using the HTTP Analyzer with Web Services.............................................................. 8-12 8.3.14.1 Testing Web Services with the HTTP Analyzer.................................................... 8-12 8.3.14.2 Using the HTTP Analyzer with RESTful Web Services....................................... 8-13 8.3.15 Using the HTTP Analyzer with WebSockets................................................................ 8-15 8.3.16 Reference: Troubleshooting the HTTP Analyzer ......................................................... 8-15 8.3.16.1 Running the HTTP Analyzer While Another Application is Running ............. 8-15 8.3.16.2 Changing Proxy Settings .......................................................................................... 8-15 8.4 Profiling Applications ............................................................................................................. 8-16

9 Deploying Applications9.1 About Deploying Applications................................................................................................. 9-1 9.1.1 Developing Applications with the Integrated Application Server............................... 9-4 9.1.2 Developing Applications to Deploy to Standalone Application Servers .................... 9-4 9.1.3 Understanding the Archive Formats ................................................................................ 9-5 9.1.4 Understanding Deployment Profiles................................................................................ 9-5 9.1.5 Understanding Deployment Descriptors ......................................................................... 9-5 9.1.6 Configuring Deployment Using Deployment Plans ...................................................... 9-6 9.1.7 Deploying from the Java Edition....................................................................................... 9-6 9.2 Running Java EE Applications in the Integrated Application Server ................................. 9-6 9.2.1 Understanding the Integrated Application Server Log Window................................. 9-7 9.2.2 Rules Governing Deployment to the Integrated Application Server........................... 9-8 9.2.3 Working with Integrated Application Servers ................................................................ 9-8 9.2.3.1 How to Create a New Integrated Application Server Connection........................ 9-9 9.2.3.2 How to Run and Debug with an Integrated Application Server........................... 9-9 9.2.3.3 Working with the Default Domain ......................................................................... 9-10 9.2.3.4 One-Click Running of Applications in the Integrated Application Server....... 9-11 9.2.3.5 How to Start the Integrated Application Server ................................................... 9-12 9.2.3.6 How to Cancel a Running Deployment ................................................................. 9-12 9.2.3.7 How to Terminate an Integrated Application Server .......................................... 9-12 9.2.3.8 How to Configure Startup and Shutdown Behavior for Integrated Application Servers 9-13 9.2.3.9 How to Log In to the Integrated WebLogic Server Administration Console ... 9-13

xii

9.3 Connecting and Deploying Java EE Applications to Application Servers...................... 9.3.1 How to Create a Connection to the Target Application Server ................................. 9.3.2 How to Create and Edit Deployment Profiles.............................................................. 9.3.2.1 About Deployment Profiles ..................................................................................... 9.3.2.2 Creating Deployment Profiles ................................................................................. 9.3.2.3 Viewing and Changing Deployment Profile Properties...................................... 9.3.2.4 Configuring Deployment Profiles........................................................................... 9.3.3 How to Create and Edit Deployment Descriptors....................................................... 9.3.3.1 About Deployment Descriptors .............................................................................. 9.3.3.2 About Library Dependencies................................................................................... 9.3.3.2.1 Resolved and Unresolved Libraries ................................................................ 9.3.3.2.2 Manifest Entries for Libraries ........................................................................... 9.3.3.3 Creating Deployment Descriptors .......................................................................... 9.3.3.4 Viewing or Modifying Deployment Descriptor Properties ................................ 9.3.4 How to Configure Global Deployment Preferences.................................................... 9.3.5 How to Pass Options to Target Connections When Deploying................................. 9.3.6 How to Configure Applications for Deployment ........................................................ 9.3.6.1 How to Configure an Application for Deployment to Oracle WebLogic Server 9-29 9.3.6.2 How to Configure a Client Application for Deployment.................................... 9.3.6.3 How to Configure an Applet for Deployment ...................................................... 9.3.6.4 Setting Up JDBC Data Sources on Oracle WebLogic Server ............................... 9.3.6.5 Preparing an Application for Deployment to a Third Party Server................... 9.3.7 How to Use Deployment Plans....................................................................................... 9.3.7.1 How to Create and Use Deployment Plans ........................................................... 9.3.7.2 How to Generate Deployment Plans ...................................................................... 9.4 Deploying Java Applications ................................................................................................. 9.4.1 Deploying to a Java JAR .................................................................................................. 9.4.2 Deploying to an OSGi Bundle......................................................................................... 9.5 Deploying Java EE Applications............................................................................................ 9.5.1 How to Deploy to the Application Server from JDeveloper ...................................... 9.5.2 How to Deploy a RAR File .............................................................................................. 9.5.3 How to Add a Resource Adapter Archive (RAR) to the EAR ................................... 9.5.4 How to Deploy a Metadata Archive (MAR) File ......................................................... 9.5.5 How to Deploy an Applet as a WAR File ..................................................................... 9.5.6 How to Deploy a Shared Library Archive .................................................................... 9.5.7 How to Deploy to a Managed Server That Is Down ................................................... 9.6 Post-Deployment Configuration ........................................................................................... 9.7 Testing the Application and Verifying Deployment .......................................................... 9.8 Deploying from the Command Line..................................................................................... 9.8.1 How to Deploy from the Command Line ..................................................................... 9.8.1.1 Command Usage ....................................................................................................... 9.8.1.2 How to Override Without Editing a Build Script ................................................. 9.8.2 How to Deploy Multiple Profiles from the Command Line ..................................... 9.8.2.1 How to Use Wildcard Samples ............................................................................... 9.8.2.2 How to Use Built-in Macros..................................................................................... 9.8.2.3 How to Create a Log File for Batch Deployment..................................................

9-14 9-15 9-18 9-18 9-19 9-21 9-21 9-22 9-23 9-25 9-26 9-27 9-27 9-28 9-28 9-28 9-29 ....... 9-29 9-30 9-30 9-32 9-33 9-34 9-34 9-35 9-35 9-36 9-37 9-37 9-38 9-38 9-39 9-40 9-40 9-41 9-41 9-42 9-42 9-42 9-42 9-45 9-45 9-47 9-47 9-48

xiii

9.8.3 How to Deploy from the Command Line Using Ant ................................................. 9-49 9.8.3.1 How to Generate an Ant Build Script..................................................................... 9-50 9.8.3.2 About The build.xml File ......................................................................................... 9-51 9.8.3.3 About The build.properties File .............................................................................. 9-51 9.9 Deploying Using Java Web Start ........................................................................................... 9-52 9.9.1 Purpose of the Java Web Start Technology................................................................... 9-53 9.9.1.1 Files Generated by the Create Java Web Start-Enabled Wizard......................... 9-53 9.9.1.2 Role of the Web Server in JDeveloper ................................................................... 9-53 9.9.2 How to Create a Java Web Start File .............................................................................. 9-54 9.9.3 How to Create an ADF Swing Web Archive for Java Web Start ............................... 9-55 9.9.4 How to Create a Java Client Web Archive for Java Web Start................................... 9-56 9.9.5 How to Create a Java Web Start JNLP Definition for Java Clients ........................... 9-57 9.9.6 How to Deploy an ADF Swing Web Application Archive for Java Web Start........ 9-58 9.9.7 How to Deploy a Java Client Web Application Archive for Java Web Start ........... 9-59 9.10 Deploying Using Weblogic SCA Spring............................................................................... 9-59 9.10.1 About WebLogic SCA ..................................................................................................... 9-60 9.10.2 About Spring .................................................................................................................... 9-60 9.10.3 Installing the Weblogic SCA Spring Extension ............................................................ 9-60 9.10.4 Using Oracle WebLogic SCA ......................................................................................... 9-61 9.10.4.1 How to Create WebLogic SCA Projects ................................................................. 9-61 9.10.4.2 How to Edit Oracle WebLogic SCA Definition Files............................................ 9-61 9.10.4.3 How to Deploy WebLogic SCA Applications to Integrated WebLogic Server 9-63 9.10.4.4 How to Deploy WebLogic SCA Applications to Oracle WebLogic Server....... 9-63 9.10.5 Using Spring ..................................................................................................................... 9-64 9.10.5.1 How to Create Spring Bean Applications .............................................................. 9-64 9.10.5.2 What Happens When You Create a Spring Bean Configuration File ............... 9-64 9.11 Troubleshooting Deployment ................................................................................................ 9-65 9.11.1 Common Deployment Issues.......................................................................................... 9-65 9.11.1.1 [Deployer: 149164] The domain edit lock is owned by another session in exclusive mode - hence this deployment operation cannot proceed 9-65 9.11.2 How to Troubleshoot Deployment to Integrated Application Servers .................... 9-65 9.11.2.1 Stopping Integrated Application Server ................................................................ 9-65 9.11.2.2 Running Out of Memory .......................................................................................... 9-66 9.11.2.3 Reinstalling JDeveloper in a Different Location ................................................... 9-66 9.11.3 How to Troubleshoot Deployment to Oracle WebLogic Server ................................ 9-66 9.11.3.1 ORA-01005: null password given; logon denied .................................................. 9-66 9.11.3.2 ORA-01017: invalid username/password; logon denied.................................... 9-66 9.11.3.3 [Oracle JDBC Driver] Kerberos Authentication was requested, but is not supported by this Oracle Server 9-66 9.11.3.4 Application Does Not Work After Creating a Global Data Source from the Oracle WebLogic Server Administration Console 9-66 9.11.3.5 Redeploying an Application to a Server that is Down......................................... 9-67 9.11.3.6 Attempting to Deploy to a Server that No Longer Exists.................................... 9-67 9.11.3.7 Deploying to a remove server fails with HTTP Error Code 502 ........................ 9-67 9.11.3.8 No Credential Mapper Entry Found ...................................................................... 9-68 9.11.4 How to Troubleshoot Deployment to IBM WebSphere.............................................. 9-68 9.11.4.1 Deployment Fails When EAR Contains Spaces .................................................... 9-68 9.11.4.2 Application Displays Administrative Console User Name ................................ 9-68xiv

Part III

Developing Java EE Applications

10 Getting Started with Developing Java EE Applications10.1 10.1.1 10.2 10.3 10.4 10.5 10.6 10.7 About Developing Java EE Applications ............................................................................. Java EE and Oracle Application Developer Framework ........................................... About Web Page Tools............................................................................................................ About Enterprise JavaBeans and Java Persistence Components ...................................... About Oracle TopLink ............................................................................................................ About Secure Applications..................................................................................................... About Applications That Use XML....................................................................................... About Applications That Use Web Services ........................................................................ 10-1 10-1 10-2 10-2 10-3 10-3 10-3 10-3

11 Developing Applications Using Web Page Tools11.1 About Developing Applications Using Web Page Tools ................................................... 11.1.1 Getting to Know the Source Editor Features ............................................................... 11.1.2 How to Work in the Visual Editing Environment ....................................................... 11.1.2.1 How to Expand and Collapse Container Elements ............................................. 11.1.2.2 How to Customize the Visual Editor Environment ............................................. 11.1.2.3 How to Display Invisible Elements ....................................................................... 11.1.2.4 How to Execute JSP Tags in the JSP Visual Editor ............................................... 11.1.2.5 How to Display JSP Tags by Name Only............................................................... 11.1.2.6 How to Change Keyboard Preferences .................................................................. 11.1.2.7 How to Select Web Page Elements.......................................................................... 11.1.2.8 How to Select Insertion Points in the Design Tools ........................................... 11.1.2.9 How to Insert Web Page Elements........................................................................ 11.1.2.10 How to Set and Modify Web Page Element Properties ..................................... 11.1.2.11 How to Set a Data Source for a Property ............................................................. 11.1.2.12 How to Set Properties for Multiple Elements...................................................... 11.1.2.13 How to Use Basic Commands to Manage Your Elements ................................ 11.1.2.14 How to Work with Data Tables............................................................................. 11.1.2.15 How to Work with Panel Grids............................................................................. 11.1.2.16 How to Paste Markup Code in JSP and HTML Pages ....................................... 11.1.2.17 How to View and Edit Web Page Head Content................................................ 11.1.3 How to Use the Property Inspector.............................................................................. 11.1.3.1 Editing Properties.................................................................................................... 11.1.3.2 Writing Custom Property Editors ......................................................................... 11.1.3.3 Additional Features for Customization Developers .......................................... 11.1.4 How to Use the Component Palette............................................................................. 11.1.4.1 Using the Component Palette Features ............................................................... 11.1.4.2 Overview of the Component Palette Features .................................................... 11.1.5 How to Use the Overview Editor for JSF Configuration Files ................................. 11.1.6 How to Plan Your Page Flow With JSF Navigation Diagrams ................................ 11.1.6.1 How to Work with Navigation Diagrams .......................................................... 11.1.6.2 How to Plan Page and the Navigation Flows .................................................... 11.1.6.3 How to Use the JSF Navigation Diagrammer to Manipulate JSF Pages ......... 11.1.6.4 How to Use the JSF Navigation Diagrammer for JSF Navigation Case .......... 11-1 11-1 11-3 11-6 11-7 11-7 11-8 11-8 11-8 11-8 11-10 11-11 11-11 11-12 11-12 11-13 11-14 11-15 11-15 11-15 11-16 11-17 11-17 11-17 11-18 11-18 11-18 11-19 11-21 11-21 11-21 11-24 11-25

xv

11.1.6.5 How to Publish a Diagram as a Graphic ............................................................. 11-26 11.1.7 How to Use Code Insight For Faster Web Page Coding .......................................... 11-26 11.2 Developing Applications with JavaServer Faces .............................................................. 11-27 11.2.1 How to Build Your JSF Application ............................................................................ 11-27 11.2.1.1 How to Build Your Application Framework....................................................... 11-28 11.2.1.2 How to Create Your JSF Pages and Related Business Services ........................ 11-28 11.2.2 How to Build your JSF Business Component Framework ....................................... 11-30 11.2.2.1 Support for Standard JSF Component Tag Attributes ....................................... 11-36 11.2.2.2 How to Work with Managed Beans...................................................................... 11-37 11.2.2.3 How to Work with Automatic Component Binding.......................................... 11-38 11.2.2.4 How to Bind Components to JSF Pages ............................................................... 11-39 11.2.2.5 How to Bind Components with EL Expressions ................................................ 11-39 11.2.2.6 How to Use Automatic Component Binding for Components that Allow Method Binding 11-41 11.2.2.7 How to Use Localized Resource Bundles in JSF ................................................. 11-45 11.2.2.8 How to Work with Facets....................................................................................... 11-46 11.2.2.9 How to Build JSF Views with Facelets ................................................................ 11-47 11.2.2.10 How to Convert and Validate JSF Input Data .................................................... 11-48 11.2.2.11 How to Display Error Messages ........................................................................... 11-53 11.2.2.12 How to Configure JSF Applications ..................................................................... 11-56 11.2.3 How to Run and Test JSF Applications ....................................................................... 11-58 11.3 Developing Applications with HTML Pages..................................................................... 11-58 11.3.1 How To Build Your HTML Pages ................................................................................ 11-59 11.3.2 How to Work with Cascading Style Sheets ................................................................ 11-63 11.3.2.1 How to Select and Group CSS Elements.............................................................. 11-64 11.3.2.2 How to Use the CSS Basic Tools............................................................................ 11-66 11.3.3 How to Work with HTML Tables ................................................................................ 11-67 11.3.3.1 How to Format Tables and Cells ........................................................................... 11-68 11.3.4 How to Work with HTML Forms, Text, and Images ................................................ 11-71 11.3.4.1 How to Work with HTML Forms ......................................................................... 11-71 11.3.4.2 How to Work with HTML Text............................................................................. 11-73 11.3.4.3 How to Work with HTML Images ........................................................................ 11-74 11.4 Working with Java Server Pages ........................................................................................ 11-75 11.4.1 How to Build Your JSP Application............................................................................. 11-76 11.4.1.1 JSP Core Components ............................................................................................. 11-76 11.4.1.2 How to Create JSP Pages ........................................................................................ 11-78 11.4.1.3 How to Register a Servlet Filter in a JSP Page..................................................... 11-79 11.4.1.4 Understanding Flow Control in JSP Pages .......................................................... 11-80 11.4.2 How to Debug and Deploy JSPs................................................................................... 11-80 11.4.3 How to Run a JSP............................................................................................................ 11-82 11.4.4 Understanding JSP Segments........................................................................................ 11-83 11.5 Developing Applications with Java Servlets ..................................................................... 11-83 11.5.1 Understanding Servlet Support in JDeveloper........................................................... 11-83 11.5.1.1 What You May Need to Know About Servlet Filters......................................... 11-84 11.5.1.2 What You May Need to Know About Servlet Listeners.................................... 11-84 11.5.1.3 How to Generate an HTTP Servlet........................................................................ 11-84 11.5.2 Implementing Basic Methods for an HTTP Servlet ................................................... 11-85 11.5.2.1 How to Use the HTTPServletRequest Object ...................................................... 11-85xvi

11.5.2.2 How to Use the HTTPServletResponse Object ................................................... 11.5.3 How to Create a Servlet Filter....................................................................................... 11.5.4 How to Create a Servlet Listener.................................................................................. 11.5.5 Registering a Servlet Filter in a JSP Page..................................................................... 11.5.6 How to Run a Servlet ..................................................................................................... 11.5.7 How to Debug a Servlet................................................................................................. 11.5.8 How to Deploy a Servlet................................................................................................ 11.6 Developing Applications with Script Languages ............................................................. 11.6.1 Script Language Support in JDeveloper...................................................................... 11.6.1.1 How to Work with JavaScript Code Insight ........................................................ 11.6.1.2 How to Use Breadcrumb Support......................................................................... 11.6.1.3 How to Use Structure Pane Support..................................................................... 11.6.2 Working with Script Languages................................................................................... 11.6.2.1 How to Create a Script............................................................................................ 11.6.2.2 How to Add Script Language Elements to an HTML or JSP Page................... 11.6.2.3 How to Set Syntax Highlighting ........................................................................... 11.6.2.4 How to Associate JavaScript File Extensions ...................................................... 11.6.2.5 How to Create a JSON File..................................................................................... 11.6.3 Refactoring JavaScript Code ......................................................................................... 11.6.3.1 Finding Usages of Code Elements ........................................................................ 11.6.3.2 Renaming a JavaScript Code Element .................................................................. 11.6.3.3 Deleting a JavaScript Code Element ..................................................................... 11.6.3.4 How to Preview a Refactoring Operation............................................................ 11.6.3.5 How to Reformat JavaScript Code ........................................................................ 11.6.3.6 How to Change Code Formatting Preferences ................................................... 11.6.3.7 How to Use Code Folding ...................................................................................... 11.6.3.8 How to Refactor and Move a File.......................................................................... 11.7 Working with JSP and Facelet Tag Libraries ..................................................................... 11.7.1 How to Use Tag Libraries with Your Web Pages ...................................................... 11.7.2 How to Work with Custom Tag Libraries ..................................................................

11-86 11-86 11-87 11-87 11-88 11-89 11-89 11-89 11-90 11-90 11-91 11-91 11-91 11-91 11-92 11-93 11-93 11-93 11-94 11-94 11-95 11-95 11-96 11-96 11-97 11-97 11-97 11-98 11-98 11-99

12 Developing with EJB and JPA Components12.1 About Developing with EJB and JPA Components ............................................................ 12.2 Support For EJB Versions and Features................................................................................ 12.3 Building EJB 3.0 Applications and Development Process ................................................. 12.3.1 EJB 3.0 Application Development Process.................................................................... 12.3.1.1 Creating Entities ....................................................................................................... 12.3.1.2 Creating Session Beans and Facades ..................................................................... 12.3.1.3 Deploying EJBs .......................................................................................................... 12.3.1.4 Testing EJBs Remotely .............................................................................................. 12.3.1.5 Registering Business Services with Oracle ADF Data Controls ......................... 12.4 How to Work with an EJB Business Services Layer ........................................................... 12.5 Using Java EE Design Patterns in Oracle JDeveloper......................................................... 12.6 Building a Persistence Tier .................................................................................................... 12.6.1 About JPA Entities and the Java Persistence API ........................................................ 12.6.1.1 JPA Entities are POJOs.............................................................................................. 12.6.1.2 Metadata Annotations for O-R Mapping .............................................................. 12-1 12-1 12-4 12-4 12-4 12-4 12-4 12-5 12-5 12-5 12-6 12-6 12-6 12-7 12-7

xvii

Inheritance and Polymorphism Support ............................................................... 12-8 Simplified EntityManager API for CRUD Operations ........................................ 12-8 Query Enhancements ............................................................................................... 12-9 How to Create JPA Entities ............................................................................................ 12-9 About SDO For EJB/JPA ................................................................................................. 12-9 Using an EJB/POJO-based ADF-BC Service for Deployment to the SOA Platform ......... 12-10 12.6.5 How to Create an SDO Service Interface for JPA Entities ........................................ 12-10 12.6.5.1 How to Configure an EJB/POJO-based ADF-BC Service for Deployment to the SOA Platform 12-11 12.6.5.2 File Types Created to Support Your SDO Architecture..................................... 12-11 12.6.6 How to Generate Database Tables from JPA Entities ............................................... 12-11 12.6.7 JDK 5 Annotations for EJB/JPA ................................................................................... 12-12 12.6.7.1 EJB 3.0........................................................................................................................ 12-12 12.6.7.2 JPA 1.0 ...................................................................................................................... 12-13 12.6.8 How to Annotate Java Classes...................................................................................... 12-13 12.6.9 Representing Relationships Between Entities ............................................................ 12-14 12.6.10 Java Persistence Query Language ................................................................................ 12-14 12.6.11 JPA Object-Relational Mappings .................................................................................. 12-14 12.6.12 How to Use Java Service Facades................................................................................. 12-15 12.7 Implementing Business Processes in Session Beans ......................................................... 12-15 12.7.1 Using Session Facades ................................................................................................... 12-16 12.7.2 How to Create a Session Bean....................................................................................... 12-16 12.7.3 How to Create Session or Message-Driven Beans in Modules ................................ 12-17 12.7.4 How to Add, Delete, and Edit EJB Methods .............................................................. 12-18 12.7.5 How to Add a Field to an EJB ....................................................................................... 12-19 12.7.6 How to Remove a Field From an EJB .......................................................................... 12-19 12.7.7 Customizing Business Logic with EJB Environment Entries ................................... 12-20 12.7.8 Exposing Data to Clients ............................................................................................... 12-20 12.7.9 How to Identify Resource References ......................................................................... 12-20 12.7.10 How to Define a Primary Key for an Entity ............................................................... 12-21 12.7.11 How to Specify a Primary Key for ADF Binding....................................................... 12-22 12.7.12 How to Use ADF Data Controls for EJBs .................................................................... 12-22 12.8 Modeling EJB/JPA Components on a Diagram ................................................................ 12-22 12.9 Deploying EJB Modules and JPA Persistence Units ........................................................ 12-23 12.9.1 About EJB Modules ....................................................................................................... 12-23 12.9.2 About JPA Persistence Units......................................................................................... 12-23 12.9.3 How to Create a JPA Persistence Unit ........................................................................ 12-24 12.9.4 How to Remove EJBs in a Module ............................................................................... 12-24 12.9.5 How to Import EJBs into JDeveloper .......................................................................... 12-24 12.9.6 How to Modify EJB/ADF Applications to Deploy to Websphere Application Server .... 12-25 12.10 Running and Testing EJB/JPA Components ..................................................................... 12-25 12.10.1 How to Test EJB/JPA Components Using the Integrated Server............................ 12-25 12.10.2 How to Test EJB/JPA Components Using a Remote Server .................................... 12-25 12.10.3 How to Test EJB Unit with JUnit .................................................................................. 12-26 12.6.1.3 12.6.1.4 12.6.1.5 12.6.2 12.6.3 12.6.4

xviii

13 Developing TopLink Mappings13.1 About Developing TopLink Mappings ................................................................................ 13.1.1 Considering the Impedance Mismatch.......................................................................... 13.1.2 Designing TopLink Applications ................................................................................... 13.1.3 Using TopLink in Application Design........................................................................... 13.1.4 Creating TopLink Metadata ............................................................................................ 13.1.5 Creating Project Metadata ............................................................................................... 13.1.6 Creating Session Metadata .............................................................................................. 13.1.7 Using TopLink Descriptors ............................................................................................ 13.1.7.1 Relational Descriptors............................................................................................... 13.1.7.2 EIS Descriptors........................................................................................................... 13.1.7.3 XML Descriptors........................................................................................................ 13.1.8 Using TopLink Mappings................................................................................................ 13.1.8.1 Relational Mapping Types ....................................................................................... 13.1.8.2 EIS Mapping Types ................................................................................................... 13.1.8.3 XML Mapping Types ................................................................................................ 13.1.9 Understanding the TopLink Editor................................................................................ 13.1.9.1 Managing TopLink Maps ......................................................................................... 13.1.9.2 Managing TopLink Sessions .................................................................................... 13.1.9.3 Managing Persistence Configurations.................................................................... 13.1.9.4 The TopLink Structure View Toolbar..................................................................... 13.1.9.5 TopLink Project Elements in the Application Navigator ....................