you can override the bufferSize as seen in the result bufferSize param here
<action name="download2" class="org.apache.struts2.showcase.filedownload.FileDownloadAction"> <param name="inputPath">/images/struts-gif.zip</param> <result name="success" type="stream"> <param name="contentType">application/zip</param> <param name="inputName">inputStream</param> <param name="contentDisposition">filename="struts-gif.zip"</param> <param name="bufferSize">4096</param> </result> </action> org.apache.struts2.dispatcher.StreamResult contains resolveParamsFromStack protected void resolveParamsFromStack(ValueStack stack) { ....... Integer bufferSize = (Integer) stack.findValue("bufferSize", Integer.class); if (bufferSize != null) { setBufferSize(bufferSize.intValue()); } ...... } bufferSize cannot exceed max int size as mentioned the default buffersize of 1024 is usually more than adequate if you make the change to bufferSize attribute,accessor and mutator methods we would like to see the refactor thx Martin ______________________________________________ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. > Date: Tue, 30 Jun 2009 19:07:17 -0400 > From: d...@newfield.org > To: user@struts.apache.org > Subject: Re: [S2] Can't setBufferSize on StreamResult from action > configuration (Struts2 2.1.6) > > Francisco José Aquino García wrote: > > 2009/6/26 Dale Newfield <d...@newfield.org>: > >> The result doesn't evaluate bufferSize. You can't put in OGNL there. > > > > So... bufferSize in StreamResult would need to be parsed in a similar > > way to contentLength to parse OGNL expressions? > > Right. There's no magic. OGNL isn't magically replacing the expression > with a primitive that can be set as a primitive -- rather the result > accepts a string expression, assumes it's an ognl expression and > evaluates it, and uses the result of that evaluation as the value. > > >> "${buffSize}" is a String. > > > > Ok, I understand that as it isn't being parsed as OGNL bufferSize > > won't accept anything but a literal, but why my expression is a > > String, as buffSize is defined as int in ThumbnailAction? Surely my > > understanding of OGNL is quite limited. How should I rewrite it to > > evaluate as an int? > > The problem is that there is no evaluation going on for that value. If > you need to dynamically set the buffer size, you'll need to use a > different result implementation that accepts a string and evaluates it. > Extending StreamResult would get you most of the way there. If you'd > like to contribute your improvements back to the community, you can add > those patches to a JIRA request. May I ask why you need to dynamically > change the buffer size? > > -Dale > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > _________________________________________________________________ Hotmail® has ever-growing storage! Don’t worry about storage limits. http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage_062009