struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francisco José Aquino García <fj.aqu...@gmail.com>
Subject Re: [S2] Can't setBufferSize on StreamResult from action configuration (Struts2 2.1.6)
Date Sat, 04 Jul 2009 07:57:56 GMT
2009/7/1 Dale Newfield <dale@newfield.org>:
> 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?

ThumbnailAction uses a resolve() method that translates a document id
into a thumbnail filename to get the stream to the client. When I saw
that StreamResult uses a bufferSize parameter I thought that perhaps
it would be a good idea to use the filesystem block size where the
thumbnail resides as the bufferSize, as different thumbnails may
reside in different filesystems (it's hardcoded into the action in the
first post, but that path/filename will come out of a DB.) It will be
a very frequently used action, with anywhere between 2-200 thumbnails
per page.

That's it. I didn't think very much about it really, I'm not an expert
in Java IO so maybe this makes not much sense (the same goes for using
BufferedInputStream instead of just the default InputStream.)

-Fran Aquino

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message