This week's book giveaway is in the Security forum.
We're giving away four copies of Penetration Testing Basics and have Ric Messier on-line!
See this thread for details.
Win a copy of Penetration Testing Basics this week in the Security forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question for double click issue regarding fileload with commandLink/CommandButton

Yasushi Okubo
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi experts,

I have multiple download links [commandLink] /buttons[commandButton] on the same page. I realized that a user needs to click twice to see an open directory window from the second attempt, I do not understand why this is happening.

The download page was implemented with jsp page. commandLink/commandbutton are simply taking a user to this download page by clicking a link or a button.

At the first click, a use always go to this page and the browser asks a user if one wants to save a directory or open on the browser. Then a user can decide to cancel or save or open. At the second attempts, the problem is that a user clicks link/button subsequently right after the first attempt, the action does not take a user to the jsp page, and it only reloads page with a round trip.
Then a user needs to click a link/ a button second time, then it works.

Could someone advise me why this is happening and is there anyway to stop this ?

I implemented a commandbutton + actionListener [in backing bean] solution for file download, but the result was the same. From the second attempt, a user always needs to click twice [double click] button.
I saw the one post on google is that adding _blank on form tag helps, but it actually did not help at all.

Any idea ?


==== partial code for jsp page ====

if(allowCache == null || allowCache.equalsIgnoreCase("false"))
response.setHeader("pragma", "no-cache");
response.setHeader("Cache-control", "no-cache, no-store, must-revalidate");
response.setHeader("Expires", "01 Apr 1995 01:10:10 GMT");
response.addHeader("Cache-Control", "post-check=0, pre-check=0");
response.setDateHeader ("Expires", 0);


if(fileName != null)

StringBuffer contentDisposition = new StringBuffer();

contentDisposition.append("attachment;");"==> attachement");


response.setHeader ("Content-Disposition", contentDisposition.toString());

if (bytes != null)
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic