File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Doing sleep on JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Doing sleep on JSP" Watch "Doing sleep on JSP" New topic
Author

Doing sleep on JSP

deepak
Greenhorn

Joined: Apr 20, 2007
Posts: 3
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

Joined: Jan 10, 2002
Posts: 61413
    
  67

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61413
    
  67

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

Joined: Dec 11, 2004
Posts: 13410

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.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doing sleep on JSP