Search This Blog

Tuesday, July 14, 2009

In HTML Reload Parent window from child window:

In HTML Reload Parent window from child window:

When I am working for a client, I have received one requirement.

Requirement IS:

Re-Load the parent window when ever clicking button in Child window.

Solution:

1. Consider two file called parent_window.html and child_window.html.

2. Open child window from parent window using javascript.

Window.open(“child_window.html”);

3. In child_window.html write javascript function called reloadParentWindow()

Function loadParentWindow()

{

If (opener)

Opener.location.reload();

}

You can call this function from child window.

function reloadParentWindow(){

//////this line of code will actually reload the parent window

if(opener)opener.location.reload();

}

Opener keyword returns the reference of the parent windows objects.

Sunday, July 12, 2009

Why Servlet Filter??

Here i am interesting to describe about Servlet filter.
First, We have to understand why we are going for servlet filter.
Reason is very simple.
If you want to redirect or Bi -pass each and every request of the web application through one way direction In J2EE based application.
I think you guys are under stand things.

The Java Servlet specification version 2.3 introduces a new component type, called a filter. A filter dynamically intercepts requests and responses to transform or use the information contained in the requests or responses. Filters typically do not themselves create responses, but instead provide universal functions that can be "attached" to any type of servlet or JSP page.

I hope soon come with more about Filter.