Posts

Showing posts from September, 2015

Hello World restful webservice with jersey filter.

Image
Hi All, In this post I am going to show you how you can create the Hello World restful webservice with jersey filter or jersey interceptor. In this example I am also going to show you how you can deal with different types of response like simple String, HTML, XML or JSON. For getting started with this prerequisites are as follows: 1) You should have a eclipse IDE on you system (in my case Luna is the version of eclipse) 2) You should have JDK installed on you system (in my case jdk 1.7) 3) You should have any server installed on your system (in my case weblogic 10.3.6) Now let's start by creating a fresh project in eclipse. To create the fresh project click on "File" then "New" and then select "Project" from available option as shown below: After this you will get the following screen where you need to select "Dynamic Web Project" from the available option. Now click on Next. on next screen provide the Pro...

How to set text from iframe to parent using javascript

Image
Hi All, In this post I am going to show you how you can set the text on parent page by just clicking inside iframe. So please use the below code for this purpose: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> </head> <body> <script> var isOverIFrame = false; function processMouseOut() {     isOverIFrame = false;     } function processMouseOver() { isOverIFrame = true; } function processIFrameClick() {     if(isOverIFrame) {  var newP = document.createElement("p");       var text = document.createTextNode("Kunal Kumar");       newP.appendChild(text);       document.body.appendChild(newP);       top.focus();     } } function init() {     var element = document.getEl...

Getting clicked event inside the ifarme using javascript

Image
Hi All, Today I was trying to get the click event from the iframe using javascript. I am not good at javascript, so it took me some time to get this to be done. So I have decided to publish it on my blog so that it will be help for at least those guys who are not good at javascript like me :) I have written the following code to get the click event from iframe in javascript.   <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> </head> <body> <script> var isOverIFrame = false; function processMouseOut() {     isOverIFrame = false;     } function processMouseOver() { isOverIFrame = true; } function processIFrameClick() {     if(isOverIFrame) { alert('Mouse is clicked');       top.focus();     } } function init() {     var element = document.ge...

Basic Authentication in Weblogic 10.3.x with Restful Webservices

Image
Hi All, Today I was trying to test on of the restful webservice with RESTClient plugg-in of Mozilla firefox. as shown below: As you can see that in the above screenshot I am trying to send the authentication parameter as well with request in request header. But once I click on the send button, the webservice was not getting invoked and I was getting the following error : <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Draft//EN"> <HTML> <HEAD> <TITLE>Error 401--Unauthorized</TITLE> </HEAD> <BODY bgcolor="white"> <FONT FACE=Helvetica><BR CLEAR=all> <TABLE border=0 cellspacing=5><TR><TD><BR CLEAR=all> <FONT FACE="Helvetica" COLOR="black" SIZE="3"><H2>Error 401--Unauthorized</H2> </FONT></TD></TR> </TABLE> <TABLE border=0 width=100% cellpadding=10><TR><TD VALIGN=top WIDTH=100% BGCOL...