Define a bean of java.io.FileInputStream in Spring makes the Struts stream result not work

2015-10-25 Thread Alireza Fattahi
We are using the struts with spring in a project. Consider a simple action with **stream** result     @Action(value = "sample-export",     results = { @Result(name = "success", type = "stream", params = {     "inputName&

Re: what's the Bootstrap when I use "stream" result type for a picture output

2015-09-24 Thread Mike Guo
hi, thanks for your response. I got this solved . here’s the article I searched, it can explain why and how about this thing. http://www.oracle.com/technetwork/articles/javase/headless-136834.html thanks again Mike.G

Re: what's the Bootstrap when I use "stream" result type for a picture output

2015-09-24 Thread Christoph Nenning
> Hi. all. > > I got a very strange issues. > > I tried to generate dynamic check code by struts2. so, I used > buffered image and javax.imageio for a byteinputstream in my Action. > > look like the function work fine. but strange thing is: every time > when I access that dynamic check code

Re: what's the Bootstrap when I use "stream" result type for a picture output

2015-09-23 Thread Mike Guo
and I think the finally answer is here: http://www.oracle.com/technetwork/articles/javase/headless-136834.html just for record. Mike.G > 在 2015年9月24日,12:05,Mike Guo 写道: > > ok, finally, I got the solution for this on

Re: what's the Bootstrap when I use "stream" result type for a picture output

2015-09-23 Thread Mike Guo
ok, finally, I got the solution for this one. although I don’t know why. I just add one java param in here: java -Djava.awt.headless=true then it will be gone. thanks Mike.G > 在 2015年9月24日,12:02,Mike Guo 写道: > > ok, I just found it is not related with tomcat or struts. > > I just use t

Re: what's the Bootstrap when I use "stream" result type for a picture output

2015-09-23 Thread Mike Guo
ok, I just found it is not related with tomcat or struts. I just use this code: import java.util.Arrays; import javax.imageio.ImageIO; public class ListImageFormatters { public static void main(String[] args) { String[] readerFormatNames = ImageIO.getReaderFormatNames();

Re: what's the Bootstrap when I use "stream" result type for a picture output

2015-09-23 Thread Mike Guo
Anyone? Please. 发自我的 iPhone > 在 2015年9月24日,02:15,Mike Guo 写道: > > Hi. all. > > I got a very strange issues. > > I tried to generate dynamic check code by struts2. so, I used buffered image > and javax.imageio for a byteinputstream in my Action. > > look like the function work fine. but

what's the Bootstrap when I use "stream" result type for a picture output

2015-09-23 Thread Mike Guo
Hi. all. I got a very strange issues. I tried to generate dynamic check code by struts2. so, I used buffered image and javax.imageio for a byteinputstream in my Action. look like the function work fine. but strange thing is: every time when I access that dynamic check code action. system wil

RE: Stream Result Returns Empty File

2013-11-14 Thread Martin Gainty
Congrats on the good news Z Martin __ > Date: Thu, 14 Nov 2013 11:14:20 +1100 > Subject: Re: Stream Result Returns Empty File > From: zo...@sparecreative.com > To: user@struts.apache.org > > Found the issue. >

Re: Stream Result Returns Empty File

2013-11-13 Thread Zoran Avtarovski
;I¹m seeing a really strange issue in one of our struts apps with a stream >result where the downloaded file is empty (zero bytes). > >I can¹t see where it is going wrong. I dynamically generate a zip file in >tomcat¹s temp folder and then use a Buffered input reader to pass off to >

Stream Result Returns Empty File

2013-11-12 Thread Zoran Avtarovski
I¹m seeing a really strange issue in one of our struts apps with a stream result where the downloaded file is empty (zero bytes). I can¹t see where it is going wrong. I dynamically generate a zip file in tomcat¹s temp folder and then use a Buffered input reader to pass off to the struts stream

Re: Is it possible to redirect after a Stream result action has completed?

2011-09-24 Thread Li Ying
. AJAX and JavaScript is very powerful today, If you can't implement something in the server side, maybe there are another solution in the client side. 2011/9/19 roger : > Hi > > I have a .jsp page that contains a link. When the link is clicked an action > is called that uses the

Is it possible to redirect after a Stream result action has completed?

2011-09-19 Thread roger
Hi I have a .jsp page that contains a link. When the link is clicked an action is called that uses the stream result to download a data file to the client pc. When the action is complete and all the browser generated download dialogs have been cleared, the original .jsp that contains the download

Stream result is broken

2010-10-21 Thread Stanley, Eric
So I just upgraded my app to Struts 2.2.1, from 2.0.something. I made the camelCase changes, added in the missing libs, and fired it up. All seems to be working as expected, except the results of type "stream". Im not sure why, but it will not stream anything to the browser. This is my config:

Re: Stream Result and Japanese data getting corrupted

2009-07-14 Thread David Canos
. Is there a way to set the charset in a result stream-type? the answer is yes in a little dirty way text/plain*;charset=UTF-8* inputStream can anyone change add this to the wiki? 2009/3/10 shyamb > > Hi, > > I am using Struts2 Stream Result for Downloading To Excel

RE: stream result causing action to be called multiple times

2009-05-05 Thread Andy
Yep that totally fixed it. Thanks!! Andy > Date: Tue, 5 May 2009 16:28:53 -0400 > From: d...@newfield.org > To: user@struts.apache.org > Subject: Re: stream result causing action to be called multiple times > > Andy wrote: > > I may be reading this doc wrong, but

Re: stream result causing action to be called multiple times

2009-05-05 Thread Wes Wannemacher
-3117) to >> fix that javadoc. >> >>> Also saw these: >>> >>> http://stackoverflow.com/questions/257566/using-stream-result-with-struts2 >>> >>> http://sheetalshundori.blogspot.com/2008/02/struts2-dynamic-file-download.html >

Re: stream result causing action to be called multiple times

2009-05-05 Thread Wes Wannemacher
t; fix that javadoc. > >> Also saw these: >> >> http://stackoverflow.com/questions/257566/using-stream-result-with-struts2 >> >> http://sheetalshundori.blogspot.com/2008/02/struts2-dynamic-file-download.html > > Which both now have commments correcting the mistake.  

Re: stream result causing action to be called multiple times

2009-05-05 Thread Dale Newfield
: http://stackoverflow.com/questions/257566/using-stream-result-with-struts2 http://sheetalshundori.blogspot.com/2008/02/struts2-dynamic-file-download.html Which both now have commments correcting the mistake. Thanks for letting us know where (and thanks to Chris for posting the correcting comments

Re: stream result causing action to be called multiple times

2009-05-05 Thread Chris Pratt
: > > > > > http://struts.apache.org/2.1.2/struts2-core/apidocs/org/apache/struts2/dispatcher/StreamResult.html > > > > Also saw these: > > http://stackoverflow.com/questions/257566/using-stream-result-with-struts2 > > http://sheetalshundori.blogspot.com/2008/02/struts

RE: stream result causing action to be called multiple times

2009-05-05 Thread Andy
I may be reading this doc wrong, but doesnt it state it here?: http://struts.apache.org/2.1.2/struts2-core/apidocs/org/apache/struts2/dispatcher/StreamResult.html Also saw these: http://stackoverflow.com/questions/257566/using-stream-result-with-struts2 http

Re: stream result causing action to be called multiple times

2009-05-05 Thread Dale Newfield
Andy wrote: I have an action that returns a stream result type filename="${attachmentFileName}" This mistake is so common I'm wondering if there's some struts tutorial somewhere that gets it wrong. Did you copy that setting from somewhere? http://www.w3.org/Proto

RE: stream result causing action to be called multiple times

2009-05-05 Thread Martin Gainty
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. > From: andrh...@hotmail.com > To: user@struts.apache.org > Subject: RE: stream result causing action to be called multiple times > Date: Tue, 5 May 2009 08:40:43 -0500 > >

RE: stream result causing action to be called multiple times

2009-05-05 Thread Andy
g on a Mac. OSX/Firefox. I will try testing on windows/IE. Thanks > Date: Tue, 5 May 2009 04:08:49 -0200 > Subject: Re: stream result causing action to be called multiple times > From: poulw...@gmail.com > To: user@struts.apache.org > > Hi Andy, > If so maybe the b

Re: stream result causing action to be called multiple times

2009-05-04 Thread Paweł Wielgus
Hi Andy, is multiple equal 2? If so maybe the browser is doing it because it doesn't know everything about this file - size comes to mind. If i remember correctly some browsers will do that. best greetings, Pawel Wielgus. 2009/5/4, Andy : > > Hi, I have an action that returns a st

stream result causing action to be called multiple times

2009-05-04 Thread Andy
Hi, I have an action that returns a stream result type and for some reason my action is getting called multiple times: ${attachmentContentType} filename="${attachmentFileName}" This causes some inefficiency since the action is retrieving an image from the database on each ca

Stream Result and Japanese data getting corrupted

2009-03-10 Thread shyamb
Hi, I am using Struts2 Stream Result for Downloading To Excel, by constructing the inputStream as required for Stream Result as : inputStream = new ByteArrayInputStream(getSomeStringData().getBytes("UTF-8")); My action is configured in struts.xml as follows application/cs

Fwd: Stream Result

2009-01-16 Thread Miguel
Hello, I have a little problema using a Stream Result. I don't understand how to write to an InputStream, I've seen the solution using the StringBufferInputStream but that is deprecated and if the content is big, it may be a memory problem. So I have 2 questions: how to use the str

Re: [struts] [s2] Stream Result - no content length

2008-09-09 Thread Greg Lindholm
DNewfield wrote: > > In case it's there and I'm just failing to find it, or in case this > changes (back again?) in the future, is there any reason not to put your > "new FileInputStream(...)" call in the action getter that returns the > InputStream? > That wouldn't work in the case I'm dea

Re: [struts] [s2] Stream Result - no content length

2008-09-09 Thread Dale Newfield
Greg Lindholm wrote: Your statement caused me to panic as my code was not prepared to return multiple independent streams and I'm not setting Content Length. I swear I didn't make this up, as I clearly recall fighting these bugs myself...but you're right, as I cannot currently put my finger on

Re: [s2] Stream Result - no content length

2008-09-09 Thread Greg Lindholm
DNewfield wrote: > > If you do not specify the content length in the stream result, your > stream will be requested twice (each request is required to provide an > independent stream -- a frequent source of bugs for people that don't > realize it), one of which will

Re: Stream Result

2008-09-03 Thread Gabriel Belingueres
As per BNF syntax [1], the content disposition must start with either the "inline" or "attachment" string. The filename need not be quoted: example: attachment; filename=whitepaper.pdf [1] http://www.ietf.org/rfc/rfc2183.txt 2008/9/3 Geffrey Caruso <[EMAIL PROTECTED]>: > Hey Everyone, > > > > Qu

Stream Result

2008-09-03 Thread Geffrey Caruso
Hey Everyone, Quick question concerning the Stream Reuslt I've got a result that looks something like this application/pdf pdfStream filename="whitepaper.pdf" 1024 Everything works fine until I go to save a copy of the PDF and the filename is ACTIONNAME.pdf. It do

Re: [OT] S2 Stream Result, downloading large file, advice needed

2008-08-23 Thread Gabriel Belingueres
hear any suggestions. I know that this is not >> strictly an S2 issue but it is related to using a Stream result type. If >> I >> was writing a servlet I would just get the OutputStream and write directly >> to it, putting the burden of buffering etc. onto

Re: [OT] S2 Stream Result, downloading large file, advice needed

2008-08-23 Thread Stephan Schröder
> I'm still interested in hear any suggestions. I know that this is not > strictly an S2 issue but it is related to using a Stream result type. If > I was writing a servlet I would just get the OutputStream and write directly > to it, putting the burden of buffering etc. onto t

Re: [OT] S2 Stream Result, downloading large file, advice needed

2008-08-22 Thread Brendan Billingsley
I'm still interested in hear any suggestions. I know that this is not strictly an S2 issue but it is related to using a Stream result type. If I was writing a servlet I would just get the OutputStream and write directly to it, putting the burden of buffering etc. onto the container. What I

Re: [OT] S2 Stream Result, downloading large file, advice needed

2008-08-22 Thread Greg Lindholm
I'm still interested in hear any suggestions. I know that this is not strictly an S2 issue but it is related to using a Stream result type. If I was writing a servlet I would just get the OutputStream and write directly to it, putting the burden of buffering etc. onto the container. W

[OT] S2 Stream Result, downloading large file, advice needed

2008-08-21 Thread Greg Lindholm
Hi Folks, I'm using S2 Stream result type to allow users to download a CSV "file" that I dynamically write from records selected from a database. First pass on this I'm using a StringWriter to write out the CSV data (using SuperCSV) that using the string to build a Byte

Re: Redirect after stream result

2008-07-31 Thread ManiKanta G
m: "ManiKanta G" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Wednesday, July 30, 2008 6:16 AM Subject: Redirect after stream result Hi, How can I redirect to another page after stream result. For example redirecting to another page saying successfull

Re: Redirect after stream result

2008-07-31 Thread Martin
ecute() method actionMapping.findForward("error") ? Martin- - Original Message - From: "ManiKanta G" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Wednesday, July 30, 2008 6:16 AM Subject: Redirect after stream result Hi, How can I redirect

Re: Redirect after stream result

2008-07-30 Thread ManiKanta G
Thanks for your help. Regards, ManiKanta Laurie Harper wrote: ManiKanta G wrote: Hi, How can I redirect to another page after stream result. For example redirecting to another page saying successfully downloaded the file or adding some action message and redirecting to the same page. You

Re: Redirect after stream result

2008-07-30 Thread Laurie Harper
ManiKanta G wrote: Hi, How can I redirect to another page after stream result. For example redirecting to another page saying successfully downloaded the file or adding some action message and redirecting to the same page. You can't; there can only be one response to an HTTP request

Redirect after stream result

2008-07-30 Thread ManiKanta G
Hi, How can I redirect to another page after stream result. For example redirecting to another page saying successfully downloaded the file or adding some action message and redirecting to the same page. Thanks in advance Regards, ManiKanta G ** DISCLAIMER ** Information

Re: [Bulk] Re: [struts] "stream" result type

2008-03-11 Thread Euphreme Rinfrett
Excellent, this is great and made everything work. Thank you very much for the quick response. - Pascal Dale Newfield wrote: Euphreme Rinfrett wrote: I'm trying to use to "stream" result type to get some images to display within a portal. class="d

Re: "stream" result type

2008-03-11 Thread Nils-Helge Garli Hegvik
to put them in the application scope of the portlet session. Luckily, this is directly supported in the new portlet 2.0 secification. Nils-H On Tue, Mar 11, 2008 at 9:52 PM, Euphreme Rinfrett <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm trying to use to "stream"

Re: [struts] "stream" result type

2008-03-11 Thread Dale Newfield
Euphreme Rinfrett wrote: I'm trying to use to "stream" result type to get some images to display within a portal. class="displayExerciceAction"> ${model.imageContentType} ${model.image} name=&

"stream" result type

2008-03-11 Thread Euphreme Rinfrett
Hi all, I'm trying to use to "stream" result type to get some images to display within a portal. Based on the wiki page: http://struts.apache.org/2.x/docs/stream-result.html I did my own action that gets an image and puts it into a model. This is the struts configuration

Re: Parsed contentType in Stream result type, JR plugin

2007-03-29 Thread Dale Newfield
Patrick J Kobly wrote: 'twould be useful to be able to get StreamResult to take the contentType param as an index into the value stack (I have an action that determines content type based on user input). If you include true then you should be able to include OGNL expressions (in "${"..."}") in

Parsed contentType in Stream result type, JR plugin

2007-03-29 Thread Patrick J Kobly
G'day, Don't know if this has been mentioned before, but 'twould be useful to be able to get StreamResult to take the contentType param as an index into the value stack (I have an action that determines content type based on user input). Worked around this by extending StreamResult and overr