Developer Tools
JDeveloper
You can quickly create a project in which to organize your application files. Then work in JDeveloper's IDE to develop and test run your JSF application.
Create a New Application and Project: Use the Create Application wizard to create a generic application.
Create JSF Page Navigation: Use the Create JSF Configuration File dialog to create the configuration file, and then plan out the navigation on the JSF navigation diagram.
Create JSF Pages: Use the Create JSF Page dialog to create the starter page structure with a JSP page directive, and two taglib directives for the JSF Core and HTML tag libraries.
Design the UI: Use the JSP/HTML visual editor and Component Palette to assemble the elements of a user interface (UI) for your JSF application.
Modify the Behavior Through Code: Configure a managed bean and generate the Java class file for the backing bean. Use the Bind Action Property dialog to attach an action method to the command button and create the method in the backing bean. Add code to the action method. Then test run the JSF application to see how the page navigation works in a browser.
The JDeveloper application is the highest level in the organizational structure. While you are developing your application, it stores information about the objects you are working with. At the same time, it keeps track of your projects and all environment settings. [ tell me more...]
JSFNavigateApp.
Application templates provide you with a quick way to create the project structure for standard applications with the appropriate combination of technologies already specified. The new application created from the template appears in the Application Navigator already partitioned into tiered projects, with the associated technology scopes set in each project. [ tell me more...]
When you complete the steps for creating a new application and project, the Projects panel in the Application Navigator should look like this: [ tell me more...]
To follow along with the example, enter values or select options as shown in the instructions throughout the cue cards. Then you will be able to follow the steps in the cue cards exactly as written. [ tell me more...]
faces-config.xml. Make sure
Servlet 2.5JSP 2.1 (Java EE 1.5) is selected in the
Web Application Version
dropdown list. Click
OK.
By default, JDeveloper opens a new
faces-config.xml file as a blank JSF navigation diagram, which you will use to define the navigation between the pages of your application. [
tell me more...]
failure.
When you complete the steps for creating JSF page navigation on a diagram, the JSF navigation diagram should look something like this: [ tell me more...]
The JSF pages you create for your application using JavaServer Faces can be JSP pages (which have file extension
.jsp) or JSP documents (which have file extension
.jspx). [
tell me more...]
Login.jsp.
When you create a JSF page using the dialog, you can specify whether or not components on the page are exposed in a managed bean, to allow programmatic manipulation of the UI components. By default components are not exposed to managed beans. If you wish to bind components to managed beans, expand the Page Implementation section in the Create JSF Page dialog, then select one of the automatic binding options. [ tell me more...]
Success.jsp and
Failure.jsp, respectively, as the new page names.
When you complete the steps for creating the JSF pages, the Application Navigator should look something like this: [ tell me more...]
To create the user interface, you add JSF UI components to your JSF page. In the example, you will use a combination of integrated tools (namely, the Component Palette, JSP/HTML visual editor, and Property Inspector) to design the user interface. When you make a change to a page in one of these tools, the change is reflected in the others as well. [ tell me more...]
The two JSF libraries that provide the JSF components were included in your page when you created it. They are: [ tell me more...]
While working with standard JSF components in JDeveloper, you can view and set component tag attributes in the Property Inspector. Most of the standard JSF component tag attributes accept value expressions, that is,
#{
expression}
using JSF Expression Language (EL). For example,
#{personData.username}. [
tell me more...]
Login.
You have successfully logged in, then press Enter.
Login has failed as the output text value.
When you have completed the steps for designing the UI, the visual editor for the Login.jsp page should have an input field in which a user can enter text, and a command button to which you will add code to control the page navigation. [ tell me more...]
In addition to JSF navigation rules, other resources that your application needs are also specified in the JSF configuration file,
faces-config.xml. The resources an application might need include files that contain the text to be displayed by the application pages, and JavaBeans that define the data for the application to work with. [
tell me more...]
Automatic component binding for a page can be turned on at initial page creation time. In the Create JSF Page dialog, expand Page Implementation, then select the automatic binding option that uses a new managed bean or an existing managed bean. The option to bind to an existing managed bean is enabled only if the application has a managed bean already configured. [ tell me more...]
backing_login as the bean name, and
LoginInfo as the class name. Then enter
project1.backing as the package name. Leave
Scope
as
request. Make sure the
Generate Class If It Does Not Exist
checkbox is selected, then click
OK. Click
OK to close the Page Properties dialog.
While JSF allows you to bind a component in the user interface directly to any JavaBean, the best choice is to use JSF managed beans. [ tell me more...]
Login.jsp page to either the
Success.jsp page or
Failure.jsp page.
A JSF configuration file can contain a number of navigation rules, and a number of navigation cases for each rule. In the example so far, the following navigation rule and navigation cases were automatically created for you in
faces-config.xml when you created the JSF navigation diagram and added navigation cases in a previous cue card: [
tell me more...]
When you complete the step, the Application Navigator should look similar to this: [ tell me more...]
Copyright © 1997, 2009, Oracle. All rights reserved.