Good points - thanks gents for pointing out these issues. All my applications that I've developed have only ever had one table in one JSP, so I guess this is a simple solution for me, but maybe not for everyone. And obviously it doesn't work in the latest code.

Matt

On Friday, October 3, 2003, at 08:06 AM, Andy Pruitt wrote:


The issue is broader than just Tiles; it's anytime you need to have an exportable table that is not in the first page fragment to be processed. I've attached a test case to this email; if you go directly to test2.jsp export will work fine, but going to test.jsp and hitting export will output the file inline as text.

It seems much more intrusive to say that:
        1) Your table must always appear on it's own page
        2) You must create actions for each of the export options
        3) Your code must be tied to the internal parameter names from
the
           taglib

Than to say;
        just add this filter in web.xml if you want exports to work.    


I'm never in favor of more configuration, but if someone has already gone through all of the trouble of configuring Tiles, I don't think it is too outrageous for them to add a filter mapping to their web.xml.



This will not work in the latest beta: The "exportType" parameter name changes for any table to allow placement of more tables on the same page. You should check for any parameter like d-????-e, (for example d-1234-e)

See it on
http://www.displaytag.org/displaytag-1.0-b1-examples/example-e
xport.jsp

fabrizio


-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Matt Raible Sent: Friday, October 03, 2003 4:56 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [displaytag-user] Easy workaround to Tiles/Export Issue

I figured out an easy "workaround" to the fact that exporting
doesn't work when using Tiles.  The happens because the
response has already been committed by Tiles (when including
previous JSPs) and the displaytag is unable to set the contentType.

Here's how I'm doing it:

In struts-config.xml, create a local forward that goes directly to the
JSP:

<forward name="exportList" path="/WEB-INF/pages/userList.jsp"/>

Then in your Action, add a little logic to see if you should
forward to the definition or to the list:

    // if exportType is a parameter, forward directly to JSP
    if (request.getParameter("exportType") != null) {
        if (log.isDebugEnabled()) {
            log.debug("export detected, forwarding directly
to list jsp");
        }

        return mapping.findForward("exportList");
    } else {
        // return a forward to the user list definition
        return mapping.findForward("list");
    }

Tested with displaytag 0.8.5 on Windows XP and Tomcat 4.1.27.

HTH,

Matt




------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ displaytag-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/displaytag-user


------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ displaytag-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/displaytag-devel


<test.jsp><test2.jsp>



------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ displaytag-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/displaytag-devel

Reply via email to