OK, I've come up with a really, really ugle work-around for this.  It involves creating separate servlets for exporting and having the normal Struts actions populate the export data into a session-scoped attribute, which is then read from by the new servlets and written to output.  It's really, really annoying, but it seems to make it work.
 
Anyhow, the reason for my post is that I would like to be able to tell which export format has been selected by the user so that I can forward to the correct helper servlet.  Is there a way to determine the selected extract type from outside of DisplayTag?  Because this is executing within the Struts action itself, I don't have access to the TableModel or DisplayTag internals (that I know of).
 
Thanks!
 
Todd Farmer
 

 



From: [EMAIL PROTECTED] on behalf of Farmer, Todd
Sent: Thu 7/6/2006 4:57 PM
To: displaytag-user@lists.sourceforge.net; displaytag-user@lists.sourceforge.net
Subject: Re: [displaytag-user] Exporting issues with TableDecorators

I believe I have isolated it to a JRun issue.  I am using JRun 4, Updater 6.  When I deployed to Tomcat 5.0, I had no problems exporting.  By adding logging, I found that the Tiles were being flushed unless I explicitly included the flush="false" attribute in the <tiles:insert> tag.  That gets me through the end of the JSP template, but once the template completes, the buffer is flushed.  I haven't been able to identify any way to resolve this yet.  I'll be contacting Adobe/Macromedia shortly, but if anybody has any ideas on this, I'd love to hear them.
 
Todd Farmer
 

 



From: [EMAIL PROTECTED] on behalf of Farmer, Todd
Sent: Thu 7/6/2006 9:49 AM
To: displaytag-user@lists.sourceforge.net
Subject: Re: [displaytag-user] Exporting issues with TableDecorators

To those that are following my trek of discovery, I apologize for the excessive number of posts.  It turns out that I still have a problem.  I increased the buffer size on both the wrapped response as well as the wrapper itself to 126kb, and still no joy.  I went and added explicit flush="false" to my <jsp:include> tags.  I added the following tag to each JSP used in the tiles assembly:
 

<%@ page autoFlush="false" buffer="256kb"%>

I added logging to the filters, JSPs and Action subclass to report the committed state of the response.  What I am finding is that every step of the way reports that the response is not committed until the filter.doChain() method returns:
 
        log.debug("response is committed before filter.doChain():  " + servletResponse.isCommitted());
        filterChain.doFilter(request, wrapper);
        log.debug("response is committed after filter.doChain():  " + servletResponse.isCommitted());
I've tried varying buffer sizes from 16kb through 256kb - no impact.
 
At this point, I doubt this is a displaytag issue - more likely a JRun 4 issue - but I'm hopeful somebody might have some insight into how I can address this.  I'm about to try deploying on a server with more memory as well as deploying to Tomcat and testing there.
 
Thanks!
 
Todd Farmer
 

 



From: [EMAIL PROTECTED] on behalf of Farmer, Todd
Sent: Wed 7/5/2006 9:01 PM
To: displaytag-user@lists.sourceforge.net
Subject: Re: [displaytag-user] Exporting issues with TableDecorators

Apologies for the spam - I think I've discovered my root issue.  I found that JRun sets the default response buffer size to 4KB, and my initial (wrapped) response is probably closer to 12KB.  I'll probably just modify the custom filter to increase the response buffer for export requests.
 
 
 
Todd Farmer
 


From: Farmer, Todd
Sent: Wed 7/5/2006 5:10 PM
To: Farmer, Todd; displaytag-user@lists.sourceforge.net
Subject: RE: [displaytag-user] Exporting issues with TableDecorators

After deploying a custom filter and ExportDelegate class, it appears that the issue is that the response is committed before it gets to the ExportDelegate.  I'm using Struts and Tiles, but I can't find any specific application code that would cause the response to be committed early.  Has anybody run into this and found a solution for it?
 
Todd Farmer
 

 



From: Farmer, Todd
Sent: Wed 7/5/2006 4:17 PM
To: displaytag-user@lists.sourceforge.net
Subject: RE: [displaytag-user] Exporting issues with TableDecorators

Jorge,
 
Thanks!  I think that was indeed the root cause of my error messages.  I added the media-specific decorator parameters to the table, and the errors went away.
 
I seem to still be experiencing issues with exporting, however - and they are likely unrelated to this initial issue.  The logging doesn't indicate there are any errors, but I get a blank page (no content) when trying to export.  This is consistent, regardless of export type (CSV, Excel, XML).  I set the logging to debug for the org.displaytag package, and it tells me that the filter is active:
 
2006-07-05 16:08:20,330 [scheduler-3] DEBUG - org.displaytag.filter.ResponseOverrideFilter.init (org.displaytag.filter.ResponseOverrideFilter.java:104) bufferParam=null
2006-07-05 16:08:20,330 [scheduler-3] INFO - org.displaytag.filter.ResponseOverrideFilter.init (org.displaytag.filter.ResponseOverrideFilter.java:108) Filter initialized. Response buffering is enabled
When a request is processed for the initial list, it tells me that it is skipping the export process because the flag parameter is not set (good):
 
2006-07-05 15:59:39,002 [jrpp-0] DEBUG - org.displaytag.filter.ResponseOverrideFilter.doFilter (org.displaytag.filter.ResponseOverrideFilter.java:122) Filter has been called, but PARAMETER_EXPORTING parameter has not been found.
When I export the list, it appears that the filter has done it's job:
 
2006-07-05 16:09:20,502 [jrpp-3] DEBUG - org.displaytag.filter.ExportDelegate.writeExport (org.displaytag.filter.ExportDelegate.java:72) Filter operating in buffered mode.
2006-07-05 16:09:20,502 [jrpp-3] DEBUG - org.displaytag.filter.ExportDelegate.writeExport (org.displaytag.filter.ExportDelegate.java:78) {contenttype=text/xml, buffer=true, filename=, body=<?xml version="1.0"?>
<table>
<row>
<column>green</column>
<column>Todd</column>
<column>Farmer</column>
</row>
<row>
<column>blue</column>
<column>Todd</column>
<column>Farmer</column>
</row>
</table>
}
 
 
Yet, somehow, at the end of the process, I get no response content.
 
Any ideas what I may be doing wrong?
 
Thanks!
 
Todd Farmer

 



From: [EMAIL PROTECTED] on behalf of Jorge Barroso
Sent: Wed 7/5/2006 3:08 PM
To: displaytag-user@lists.sourceforge.net
Subject: Re: [displaytag-user] Exporting issues with TableDecorators

Todd,

Sounds like issue 298, http://jira.codehaus.org/browse/DISPL-298.
I've posted a patch there, along with documenation.

-J

"Farmer, Todd" <[EMAIL PROTECTED]> wrote:
Hi,
 
I am using DisplayTag 1.1, and I have created table decorators so that I can format the data in the columns and provide links (with multiple parameters in the query string).  Everything has been going well, until I try to export the data in any format.  I'm using Struts, and have implemented the filter per the DisplayTag documentation.
 
The issue appears to be that the export process is using the undecorated domain object rather than the custom TableDecorator I created.  The error I see in the logs is:
 
006-07-05 14:52:16,893 [jrpp-0] ERROR - org.apache.struts.taglib.tiles.InsertTag.doEndTag (org.apache.struts.taglib.tiles.InsertTag.java:922) ServletException in '/WEB-INF/jsp/templates/SearchTemplate.jsp': ServletException in '/WEB-INF/jsp/tiles/SearchResult.jsp': Error looking up property "linkedEntityCode" in object type "com.mycompany.domain.AccountDetails".
jrun.jsp.runtime.UncaughtPageException: Unhandled exception thrown from /WEB-INF/jsp/templates/SearchTemplate.jsp:4
I've added the following line to my display.properties file, but it had no effect (and from the documentation, I understand that this is the default value as well):
 
export.decorated=true
Are there any suggestions on how to address this?
 
Thanks!
 
Todd Farmer
 

 

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
displaytag-user mailing list
displaytag-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-user


Want to be your own boss? Learn how on Yahoo! Small Business.
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
displaytag-user mailing list
displaytag-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-user

Reply via email to