Create an ADF application and within the model create a new java class
Write the following code in the java class
package myproject;
public class HelloWorld {
public HelloWorld() {
super();
}
public String sayHi(String val) {
return "Hello " + val;
}
}
Right click on java program thus created and say create data control
Once the wizard is completed you can see following resource in your data control tab
Now go to your web content folder and create a page.
Make sure you have selected the option create as XML document.
now drag and drop the sayHi method as highlighted in to the page and select ADF parameter form
next drag and drop the output variable which is represented by STring in the data control to the adf page and select it as adf output
SAve all your work ,select the page and say run
Now pass some input and click on test button to get the result as shown below
No comments:
Post a Comment