aspose file tools*
The moose likes Struts and the fly likes is it possible to forward back the protected zip file Behind WEB-INF in Websphere Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "is it possible to forward back the protected zip file Behind WEB-INF in Websphere " Watch "is it possible to forward back the protected zip file Behind WEB-INF in Websphere " New topic
Author

is it possible to forward back the protected zip file Behind WEB-INF in Websphere

grace smith
Greenhorn

Joined: Jun 14, 2005
Posts: 23
Hello,

I am using the Websphere 5.1 container.
in my jsp page I have a link which should linke to one secure zip file, we'd like to put under the /WEB-INF/ since the webuser can't directly access them by typing the file URL.

but the authorized user should still be able to access it, so I tried to make the access link to call a Struts action, which forward back the zip file. somehow, it does not work. I am wondering does Websphere container suport server side redirect files which are put under /WEB-INF?


here is the struts action mapping I used (which is not working, the web page display HTTP 403 forbidden error) :
path="/download"
type="org.apache.struts.actions.ForwardAction"
parameter="/WEB-INF/downlaod/my.zip" />


Can someone shed me some light on this?

thanks
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
If you really want to store this file in WEB-INF, you can't access it through a forward or a link, as security will stop you. You will have to write an action class that will read this file using the java.io.* classes, and then output it to an output stream in HTTPServetResponse. Unzip the struts-examples.war that comes with the Struts 1.2 download, and look at ImageAction.java for an example of how to do this.


Merrill
Consultant, Sima Solutions
grace smith
Greenhorn

Joined: Jun 14, 2005
Posts: 23
Thanks Merrill, did struts1.0/1.1 suport this streaming? I am using struts1.0, from the examples there I don't see thay have the streaming examples.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
There's nothing new about the streaming technique. I'm sure it will work with Struts 1.1. It's just that the 1.2 download has an example of it, and the earlier download doesn't. I'd suggest downloading the 1.2 Struts just so you can get the example.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: is it possible to forward back the protected zip file Behind WEB-INF in Websphere