aspose file tools*
The moose likes Servlets and the fly likes JSP Reload in opening attachment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "JSP Reload in opening attachment" Watch "JSP Reload in opening attachment" New topic
Author

JSP Reload in opening attachment

suchit pandya
Ranch Hand

Joined: Oct 27, 2009
Posts: 43
Hi,

In one appliation i am facing a criticle problem. all attachements attached with document are displayed in one frame of JSP(there is a main JP and 3 frames in side it for 3 different type of information). When user click on name request goes on server, it return with data (stored in blob field in database) on main jsp by request. Then on main page data is being set in session. In frame page after taking data from session by session.getattribute i remove it from session and writes it in outputstream object and File download box comes with option open/save/cancel. on clicking open attachment opens.

This works fine here at my local server and testing server properly for all type of attachment. At client side on testing server it works fine for doc,txt,pdf but for ppt,pptx and docx, after clicking on OPEN or SAVE in file download box, internal frame page reloads again and it tries to get data from session again but as first time data is been removed from session it shows "No attachment Found".

How it can be possible?? Is it possible that this problem is dew to any browser settings or server settings?
We use IE 7 browser. Here is the code of inner frame JSP.








I am getting all file name / content type proprrly first time. No request submmited at server when this JSP reloads.

Thanks in advance.
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9321
    
  17

It is not very clear to me what you are trying to do, but it looks like a design flaw in the application. You are using a lot of scriptlet code in your JSPs which is not good. Putting full data of files in session might slow down your application. Can you please tell us how the file's data got into the session i.e. where and when did you read it from the database. What are you actually trying to achieve here?? We might be able to give you a better way to solve the problem...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
suchit pandya
Ranch Hand

Joined: Oct 27, 2009
Posts: 43
Actually This page is included in another JSP as frame. In that Data is coming in request but request is not accessable in this frame page so i have to write data in session.

When user clicks on Attachment name I neeed to read it.
In main JSP it is been called like.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP Reload in opening attachment