window closing javascript in javabean reporting error

Hi,

i want to closed jsf page on button clicked, i am using the that code in javabean my code is like this.

public void closeWindowClicked(ActionEvent event) {

try

{

FacesContext facesContext = FacesContext.getCurrentInstance();

String javaScriptText = "window.close();";

// Add the Javascript to the rendered page's header for immediate execution

AddResource addResource = AddResourceFactory.getInstance(facesContext);

addResource.addInlineScriptAtPosition(facesContext, AddResource.HEADER_BEGIN, javaScriptText);

}

catch(Exception e)

{

System.out.println(""+e);

}

}

i am getting this error .->

Exception while invoking expression #{tanishqBean.closeWindowClicked}

i want to keep that javascript code into method only becoz i want to perform two task on clicking of single button.

can any one help me.

thanks

[938 byte] By [SoftwareSolutionsa] at [2007-11-27 11:56:55]
# 1

What is the exception message and stack trace?

RaymondDeCampoa at 2007-7-29 19:10:17 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...