This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with download prompt cancel button

 
saipraneeth nallapareddy
Ranch Hand
Posts: 159
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello everyone,

I am developing an application when user clicks on a button by selecting a file it shows the download prompt with Open/Save/Cancel, Open and Save are working fine. But when clicked on cancel button there is an error being raised on the server with network exception SocketException is being throwed.

How to handle this issue. Can anyone help me in this regard.
 
Michael Angstadt
Ranch Hand
Posts: 277
Eclipse IDE Java PHP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like maybe you are not properly closing the connection on the client side when Cancel is clicked.
 
saipraneeth nallapareddy
Ranch Hand
Posts: 159
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no i have closed all the connections in the finally block.
 
Michael Angstadt
Ranch Hand
Posts: 277
Eclipse IDE Java PHP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like you are opening the connection before the user clicks any of the buttons. Maybe you should instead wait for the user to click a button to open the connection. So, if the user clicks Cancel, you can just close the dialog window and the connection will never have been opened, thus preventing that exception from being thrown on the server.
 
Paul Clapham
Sheriff
Pie
Posts: 20177
25
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This cancel button you're describing... is it the one which the browser displays when it decides a response is a file to be downloaded? In that case the error is perfectly normal. It's the same error which occurs when the user interrupts a large page load by clicking on some other link.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic