Emmanuel Pregnolato

+ Follow
since Jun 09, 2003
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Emmanuel Pregnolato

I had a similar problem.

With firefox, when I run a small JSF application i loose my session quickly for no reason.

What I have do to resolve this problem is to go in FF settings.
Tools > Options > Privacy. Then click on "Accept cookies from sites". Keep until they expire.

Hope this helps.

11 years ago
As Vladimir pointed out it seems like a bug with IE and Acrobat.
I tried with Netscape and it work perfectly !!!
i.e.: The html page is displayed over the PDF.
Vladimir, I tried without success (with IE) the following peace of code:
response.setHeader("Content-disposition", "inline; filename=" + "error.html");
Again, it work with Netscape but not with IE, instead of having the blanc page with the pop up message, the browser freeze and my CPU usage jump to 100%. If I check the running processes I found Acrobat using all the CPU time. Why Acrobat is still in the portrait ?
18 years ago
Hi guy's, thanks for the support.
Let me explain further...
Here is my sequence.
1) User obtain a PDF in a browser,
(code below: if statement section).
2) The session falls into a timeout state.
3) User click refresh on the browser.
4) The servlet capture the refresh and validate the session.
5) Session is invalid => try to display an html error message instead of the PDF on the same window.
(code below: else statement section).
The problem occured at step 5: the browser window shown is blanc and a pop up window appear with the message "File does not begin with %PDF-".
Here is a sample of my code in my servlet.
//Get the "channel"
OutputStream out = response.getOutputStream();
//Validate the session.
HttpSession session = request.getSession(false);
if(session != null && !session.isNew()){
//Retreive the Service Name.
response.setHeader("Content-disposition", "inline; filename=" + thispbn.getPDFFileName());
//Render the PDF.

//Set the mime type and sub mime type to HTML.

//Retreive a new writer in function of the new assigned mime type.
out = response.getOutputStream();
out.print("time out message");
Thanks again for your help, hope it will clarify my problem.
18 years ago
I re-open my thread locked
I have the following problem.
1) I open a PDf document in a browser. It's a servlet that generate (shoot) the PDF document.
2) If the user click on the refresh button a request is made to the servlet. The servlet validate the session. If the session is invalid I want to display a timeout page (jsp page).
3) The timeout page has to be displayed in the same window that I used to display the PDF. But I keep getting the pop up error message "File does not begin with %PDF-".
Even if I force the mime type to be "text/html".
18 years ago