• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
grace smith
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
A day job? In an office? My worst nightmare! Comfort me tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic