• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doing sleep on JSP

 
deepak
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,,

I have s jsp page which has a database driven menu. Now at the end of the page I have a condition check and if it is true, the I use javascript to submit to a controller(Java file) which will open up a attachment using the code:

response.setHeader("Content-Disposition", "attachment; filename=\"" + sFileName + "\"");

Now the problem I have is when page starts rendering, sometimes this pop up comes even before the menu is created on the page. As a result menu is not shown on the page. Can somebody suggest me a feasible solution.

Thanks,
Deepak
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please take the time to choose the correct forum for your posts. This forum is for questions on general Java.

This post has been moved to a more appropriate forum.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by deepak pooja:
if it is true, the I use javascript to submit to a controller


Submitted to where? The current window?

Perhaps you should show us that JavaScript code. Please use UBB code tags when posting code.
[ April 20, 2007: Message edited by: Bear Bibeault ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by deepak pooja:
Now at the end of the page I have a condition check and if it is true, the I use javascript ....


Rather than putting your javascript check in the page body (or whatever you meant by "end of the page"), you should be using the body's onload event to trigger this check.

"onload" doesn't get called until the entire page body is done loading.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic