Invoking REST webservice from JQuery using an AJAX call

Below code helps you to understand how we can Invoke a REST web service on click of a button using JQuery and AJAX.

Note: In Java you can Invoke REST web service using ApacheHTTPClient library.

HTML File:

<!DOCTYPE html>
<sscript type=”text/javascript”
<sscript type=”text/javascript”>
$(document).ready(function () {
$(“#mybutton”).click(function () {

$.ajax( {
type : “GET”, url : “;, dataType : “json”, success : function (data) {
alert(“Reading Msg: ” + data.RestResponse.messages);
alert(“Reading Name: ” +;


<button type=”button” id=”mybutton”>Invoke REST WS</button>

Sample REST Services (thanks for making them available to developers for testing purpose):


Showing Parameters passed in the URL in a page – Oracle ADF

In ADF Application we can read the parameters passed in the URL and display them as an output text using a simple EL (Expression language).


Sample Jspx page:


Page in browser:

2If your requirement is to show the URL passed in parameter data in the input text field and if there is no parameter data passed then show it as an input text field, then you can use below given EL which is having the ternary condition.

<af:inputText value=”#{param.dept eq null? bindings.DepartmentId.inputValue: param.dept}” />

Browser output when URL:


Browser output when URL:



This post is intended to show how the requirement can be fulfilled with the help of EL.