This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes I frame not displaying blob (document) from action class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "I frame not displaying blob (document) from action class" Watch "I frame not displaying blob (document) from action class" New topic
Author

I frame not displaying blob (document) from action class

Aditya Raghu
Greenhorn

Joined: Aug 11, 2009
Posts: 11
Hi all,


I have an iframe in a jsp class which is calling a struts2 action class in its src, but instead of opening inside the frame the file is getting downloaded,

Inside file TempContentPage.jsp:



Here is the execute method in the action class ContentPage.java



And here is the struts.xml mapping



I want to open the file inside the iframe scope, Please help me out .

Thanks, Aditya
Lorand Komaromi
Ranch Hand

Joined: Oct 08, 2009
Posts: 276
Aditya Raghu wrote:
I want to open the file inside the iframe scope, Please help me out .


I don't remember whether Firefox is able to embed MS Word inside an iframe, maybe this is possible only in IE.


OCJP 6 (93%)
Aditya Raghu
Greenhorn

Joined: Aug 11, 2009
Posts: 11
I tried in ie too, even there the file is being downloaded. Do you see any other way of passing the stream to iframe? Is there any other alternative to this?


Thanks,
Aditya
Lorand Komaromi
Ranch Hand

Joined: Oct 08, 2009
Posts: 276
I think that you're not using Struts' stream result correctly, instead of providing an InputStream and have the framework stream it to the client you're writing it directly to the servlet's output stream (is res the ServletResponse?). Take a look at the docs and fix it. Nevertheless, I don't think that this will solve your problem...
Aditya Raghu
Greenhorn

Joined: Aug 11, 2009
Posts: 11
Thanks a lot Lorand. Will look at it



Aditya
 
 
subject: I frame not displaying blob (document) from action class
 
Similar Threads
Struts2 mapping query
Dowloading a file from a a struts 2 web application
download content is outputting to my browser not creating a download file
ArrayIndexOutOfBounds Exception on OutputSteam write()
Error in displaying image using stream Result