Download presentation
Presentation is loading. Please wait.
Published byEvelyn Shields Modified over 9 years ago
1
Create a New Application and Project Open the Create Application dialog. Enter the application name of your choice and the directory. Select No Template [All Technologies] from the Application Template dropdown list, and click OK. In the Create Project dialog, enter the project name (for example, Model) and click OK.
2
In the Data Control Palette, under findContactsByName(String), expand Parameters, and then select name. Drag name to the AddressLookup.jsp page, on the form above the table. From the context menu that displays, choose Texts ADF Input text w/ label. select findContactsByName(String) and drag it to the form next to the input text field. From the context menu that displays, choose Methods ADF Command Button. In the editor window, right-click the AddressLookup.jsp file and choose Run to run the JSF page. In the browser, enter sh into the field and click the button to see the results.
3
Create a Simple JavaBean Class In the Application Navigator, select the project you just created and open the Create Java Class dialog. Enter a name for the class (for example, Contact). Enter a name for the package (for example, acme.bean). Accept the remaining defaults and click OK. In the source editor, add code to the file to create a simple JavaBean class After: package acme.bean; public class Contact { public Contact() { } Add: private String name; private String email;
4
Right-click in the file and choose Generate Accessors. In the Generate Accessors dialog, select Contact and click OK. In the source editor, add a constructor that instantiates a new Contact object using values passed as arguments. From the File menu, choose Save All In the source editor, add a constructor that instantiates a new Contact object using values passed as arguments. After: package acme.bean; public class Contact { public Contact() { } public Contact(String name, String email) { this.name = name; this.email = email; }
5
In the Application Navigator, select the project again and open the Create Java Class dialog. Enter a name for the class (for example, AddressBook). Accept the package name (acme.bean) and remaining defaults and click OK. In the source editor, add code to the file to create a collection Java class. Sample Code In the Java Source Editor, add the following code to the file. After: package acme.bean; Delete: public class AddressBook { public AddressBook() { } And replace it with: www.tud.ttu.ee~matsak/oracle/example.htm
6
In the Application Navigator, expand Model, Application Sources, and acme.bean to display the.java files. Right-click AddressBook.java and choose Create Data Control From the main menu, choose View Data Control Palette to open the Data Control Palette.
7
In the Application Navigator, select the application and open the Create Project dialog to create a new project which will contain your JSF page. Enter a project name (for example, View) and click OK. In the Application Navigator, select the project you just created and launch the Create JSF JSP wizard If the Welcome page appears, click Next. On step 1, select Servlet 2.4\JSP 2.0 for the web application type. Then click Next. On step 2, enter a name for the page (for example, AddressListing.jsp) and a directory. For the type, select JSP Page. Then click Next. On step 3, select Do Not Automatically Expose UI Components in a Managed Bean and click Finish.
8
In the Data Control Palette, expand AddressBookDataControl, expand findAllContacts(), and select Contact. Drag Contact to the AddessListing.jsp page which is open in the editor window. From the context menu that is displayed, choose Tables ADF Read-only Table. In the Edit Table Columns dialog, accept the defaults and click OK. In the editor window, right-click the AddessListing.jsp file and choose Run to run the JSF page.
9
In the Application Navigator, select Contact.xml to display its structure. In the Structure window, under the first Contact node, right-click email, and choose Properties. In the Attribute Editor dialog, select the Control Hints node. In the Label Text field, enter a label (for example, Email Address) and click OK. In the Structure window, right-click name and choose Properties. In the Label Text field, enter a label (for example, Contact Name) and click OK. In the editor window, right-click the AddessListing.jsp file and choose Run to run the JSF page again.
10
In the editor window, right-click AddessListing.jsp and choose Go to Page Definition. In the Structure window, expand executables and select findAllContactsIter to display its properties. In the Property Inspector, click in the RangeSize field and change the value from 10 to 5. Tell me more In the editor window, select the AddessListing.jsp tab, then right- click the AddessListing.jsp file and choose Run to run the page again.
11
In the Application Navigator, select the View project and launch the Create JSF JSP wizard to create another JSF page. If the Welcome page appears, click Next. On step 1, select Servlet 2.4\JSP 2.0 for the web application type. Then click Next. On step 2, enter a name for the page (for example, AddressLookup.jsp) and a directory. For the type, select JSP Page. Then click Next. On step 3, select Do Not Automatically Expose UI Components in a Managed Bean and click Finish.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.