File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to exit from a page

 
gaurav chhabra
Ranch Hand
Posts: 109
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sir
i have a button in my project and i want that if someone clicks that button then it closes the project..........
i m writting....

<html>

<head>
<title>JAI SHRI RAM</title>
</head>

<body>
<%
System.exit(0);
%>
</body>

</html>

the above code not make me close the whole project
plz suggest me the solution
 
Rohit Bhagwat
Ranch Hand
Posts: 205
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by close whole project ?
Do you mean to say close browser window ?
Using System.exit(0) will shutdown the container..

Regards
Rohit.
 
gaurav chhabra
Ranch Hand
Posts: 109
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for reply
ya sir i mean to close the browser window by clicking the button
thank you
garav
 
Rohit Bhagwat
Ranch Hand
Posts: 205
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all I am not a sir ok !!

Coming back.

Now since you said you want to close the browser window which is ofcourse of the client so that means you have to do coding that will execute at client side to close client's browser.

So use javascript that executes at client side.

<script language="javascript">
function closeWindow()
{
window.close();
}
</script>

now call this method closeWindow() in the onclick event of your button.

I guess this will prompt you to ensure that whether you want to close this window and then on clicking yes your window will be closed.

I hope I am close to your solution.
I have never tried this. But hope it works.

Regards
Rohit
 
gaurav chhabra
Ranch Hand
Posts: 109
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you very very much for ur suggestion
it works out
bye
gaurav
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic