1) Click on new Application in the Application Navigator window and then Select FusionWebApplication (ADF) as option and click next
2) Then again click next again next for model project again next for ViewControllor project and click finish.
3) Now we got Model and ViewController Projects in our example Application.
4) Right click on ViewController project and select New option then we will getting one dialog to select JSF as one option from categories and select JSF page from Items and click OK
5) Give Name as AdditionNumbers to JSPX file.
6) Select “Create as XML Document” check box and click OK button
7) Now we got AdditionNumbers.jspx created in our ViewController project then we need to add three input text components and one Button component from Component Palette 8) Choose Source option of AdditionNumbers.jspx file.
9) we need to add our 4 components with in the
tag
10) Now click on 4th icon (Save all option ) from main menu to save all the items.
11) Modify Labels as First Number and Second Number and Addition for three text boxes and modify command button text value as Submit and press Contrl+S to save our work.
12) We need to create java file to do addition operation and bind three values. 13) Right click on ViewController project and select New option
14) After that select Java from categories and choose Java Class from items then click on OK button .
15) Give Name as Addition to our java class and press OK button.
16) Now we need to add three variables as int data type and add one method to our class
17) Below are the three variables private int a; private int b; private int c; and create setters and getters to our java file through Generate Accessors option . For this we need to right click on java class and select Generate Accessors option
18) And click on Select All button
19) Now we got all the setters/getters in java file.
20) Press control+S to save all work and open adfc-config.xml file under ViewController WebContent WEB-INF adfc-config.xml
21) Then goto overview tab from bottom of the adfc-config.xml.
22) then goto Managed Beans and click green + symbol to add our managed bean.
23) Please give name as mbean and class as Addition and scope is session
24) Please press control+S to save all our activities in Jdeveloper. Now we need to bind three variables (a,b,c) to our three text boxes. Open property Inspector (press control+Shift+i) and put cursor at first text box and try to locate value attribute for our first text box.
Click on expression Builder and expand ADF Managed Beans and expand mbean and select a variable to bind first text box and click on OK button
25) We need do same thing for remaining two variables(b,c)
26) Then select command button and again open property inspector.(Control+Shift+i) Go to Action attribute and click on “V” right side of property inspector and select “Edit” and click on it
27) Please select mbean as Managed Bean name and click on new button to create new method in our Addition class.and then give Method Name as add.
28) And press ok button in the CreateMethod dialog box.
29) And press ok button in the Edit Property: Action dialog. 30) Then all the code will be looks like as given below.
And again press Control + S to save all our activities.
31) Open Addtion.java file and add below snippet of code to add method . public int add() { c=a+b; return c; }
32) and save all our activities and then run our AdditionNumbers.jspx file Right click on AddtionNumbers.jspx file then click Run option then Weblogic server will be starting then our page will be opened in browser 33) And give any two numbers in two text boxes and click submit button then result will be displayed in the third textbox