The simple days of just dropping my values onto the response stream seem
to be very much over.
// Back in the Day... (Struts 1)
response.setContentType("application/text");
response.setHeader("Content-disposition", "filename=\"Testing.csv\"");
out.println("Column1,Column2,Column3,Column4");
Iterator iter = beanQuery.getListRP().iterator();
// This returns 5 elements
while (iter.hasNext())
{
iter.next();
// the following is static garbage until the db connection is worked
out later
out.println("Data 1" + "," +
"Data 2" + "," +
"Data 3" + "," +
"Data 4");
}
out.flush();
I attempted to play with the Stream Result but crashed and burned in a
big way. I was digging in Stream Results, because of the following
blurbs at the Struts 2 site:
* Edit the Action so that it implements the ServletResponseAware
interface.
o The ServletResponseAware interface expects a
setServletResponse method. You may wish to include a
companion getServletResponse method.
* At runtime, call getServletResponse to obtain a reference to the
response object.
Only implement ServletResponseAware as a last resort. A better
approach to solving a use case
involving the response may be with a custom Result Type
<http://struts.apache.org/2.x/docs/result-types.html>.
David Durham-3 wrote:
Both of these tools use Apache POI <http://poi.apache.org/> as an
underlying Excel format generator. I wouldn't use Jasper as an Excel
generator, unless I were already using or intended to use Jasper as a
reporting engine. Display tag is only applicable, in this case, if
you need tabular data within a JSP along with an option to export in
Excel format.
POI is fairly easy to use, I've found, but it does have some memory
related problems associated with very large excel files.
-Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
<http://www.nabble.com/user/SendEmail.jtp?type=post&post=11187048&i=2>
For additional commands, e-mail: [EMAIL PROTECTED]
<http://www.nabble.com/user/SendEmail.jtp?type=post&post=11187048&i=3>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]