You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by andy wix <st...@hotmail.com> on 2004/11/23 11:15:50 UTC
Tiles and file download
Hi,
I have a requirement to allow the user to view log files in the main body
tile when they click a certain menu item in the 'menu tile'.
I see on the archives that the normal way to do this is to stream the file
to the response and then return null from the action. What's the approach
taken when using tiles?
Thanks,
andy
_________________________________________________________________
Stay in touch with absent friends - get MSN Messenger
http://www.msn.co.uk/messenger
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Tiles and file download
Posted by Dakota Jack <da...@gmail.com>.
As you no doubt see, Paul's solution is for viewing in the browser and
Matt's is for downloading to the client. You can do both if you like.
Just make the file in the browser per Paul the button for downloading
the file to the client per Matt. You can have the button do a popup
which then shows the download progress or you can go to another page
altogether which also can show the progress of the download if you
like. Blah, blah, blah. But the basic idea for downloading the file
to the client works just like you say.
I personally do not rely on the container for any downloading of
assets but always use the method you discuss in an action for resource
delivery, i.e. to all pages for images, css, etc.
Jack
On Tue, 23 Nov 2004 10:15:50 +0000, andy wix <st...@hotmail.com> wrote:
> Hi,
>
> I have a requirement to allow the user to view log files in the main body
> tile when they click a certain menu item in the 'menu tile'.
>
> I see on the archives that the normal way to do this is to stream the file
> to the response and then return null from the action. What's the approach
> taken when using tiles?
>
> Thanks,
> andy
>
> _________________________________________________________________
> Stay in touch with absent friends - get MSN Messenger
> http://www.msn.co.uk/messenger
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
--
"You can't wake a person who is pretending to be asleep."
~Native Proverb~
"Each man is good in His sight. It is not necessary for eagles to be crows."
~Hunkesni (Sitting Bull), Hunkpapa Sioux~
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Tiles and file download
Posted by Matt Bathje <mp...@ntsource.com>.
andy wix wrote:
> Hi,
>
> I have a requirement to allow the user to view log files in the main
> body tile when they click a certain menu item in the 'menu tile'.
>
> I see on the archives that the normal way to do this is to stream the
> file to the response and then return null from the action. What's the
> approach taken when using tiles?
Andy - When you do something like this, just don't have the action that
outputs the file use tiles. It won't hurt anything, and I'm pretty sure
it is the only way to do it. (Of course now 5 people will come and prove
me wrong :) )
Matt
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Tiles and file download
Posted by Dakota Jack <da...@gmail.com>.
Perhaps a bit of "theory" is what you need. When you return a
resource such as a file from an Action with a null as the value of the
ActionFoward, you do so because the action is called FROM the response
or the page which has already been committed and presented to the
client. The call to the action needs to reflect this. For example,
if the file is an image then it might be made as follows <img
src='getImage.do?image=simily_face'>. When you return the resource as
Paul suggests, then the imaged is IN the response or the page which is
committed or presented to the client. For log presentation, you might
want to use a file download. My last submission was a bit mixed up on
this. So, there are three options:
file download of log file.
browser presentation of log file (Paul)
streamed presentation of log file on the browser (Matt)
I am not sure what the page code is for the streamed presentation of
the log file on the browser and would like to see how you do that
myself, Matt. It is probably obvious and I am going to hit my
forehead with a piece of cake after seeing it.
Jack
On Tue, 23 Nov 2004 10:15:50 +0000, andy wix <st...@hotmail.com> wrote:
> Hi,
>
> I have a requirement to allow the user to view log files in the main body
> tile when they click a certain menu item in the 'menu tile'.
>
> I see on the archives that the normal way to do this is to stream the file
> to the response and then return null from the action. What's the approach
> taken when using tiles?
>
> Thanks,
> andy
>
> _________________________________________________________________
> Stay in touch with absent friends - get MSN Messenger
> http://www.msn.co.uk/messenger
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
--
"You can't wake a person who is pretending to be asleep."
~Native Proverb~
"Each man is good in His sight. It is not necessary for eagles to be crows."
~Hunkesni (Sitting Bull), Hunkpapa Sioux~
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org