Right now it is possible to set the content-dispostion header directly from
the controller. You can get the Response from the ControllerContext and then
just call response.setHeader() on it. Even when the repsonse is wrapped, the
setHeader() calls are passed through to the real underlying response. I
think this is pretty straightforward and intuitive, so I don't think there
is really a need to change it (though I am open to hearing other thoughts on
this).

If people still think its worthwhile to have this defined in maverick.xml, I
have a couple of ideas. We could add two optional attributes to the fop
transform node: filename and content-type. Filename is pretty
self-explanatory. Content-type would take either "inline" (which would be
the default) and "attachment". Together these two would produce a
content-disposition header something like:

Content-disposition: attachment; filename=myfile.pdf

So you would have a node that looked something like:

<transform type="fop" output="pdf" content-type="attachment"
filename="myfile.pdf"/>

Even if we add this, I still think the controller should take precedence.
Since it runs before the transform, opt-fop could check for the presence of
the content-disposition header. It would only set it if it didn't find it.
Does this make sense?

What are everyone's thoughts? Do you think setting the header from the
controller is sufficient, or should we add these params to the transform
node?

--jim

----- Original Message -----
From: "Mike Moulton" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 22, 2002 4:35 AM
Subject: [Mav-user] Opt-fop and Content-Disposition header


> I started playing with opt-fop for use on an upcoming project and I had a
> couple comments / questions I would like to ask. First I would like to
thank
> all those involved in producing opt-fop, I think is a very valuable tool.
>
> From my quick over of the source I notice that the content type is
specified
> based on the fop render type, however there doesn't seem to be any support
> for setting a Content-Disposition header. I'm sure there are many cases
> where the browser will automatically launch an app for the given content
> type, however for my use I need the browser to prompt the user to "save"
the
> file with a suggested filename. Currently on browsers that don't have a
> handler for the supplied content type the file is saved as the name of the
> command executed, 'friendsPdf.m' in the case of the friendbook-fop
example.
>
> Is there need by others to do the same thing? If so how should it be
> handled? I was thinking that we could supply a param to the transform with
a
> filename keyword, or possibly adding an attribute to the transform tag for
> the filename. What about dynamically producing the filename in the
> controller; how could this be handled cleanly?
>
>
> --
> Mike Moulton
> [EMAIL PROTECTED]
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Mav-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/mav-user
> Archives are available at http://www.mail-archive.com/



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Mav-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mav-user
Archives are available at http://www.mail-archive.com/

Reply via email to