AW: [opencms-dev] setContentType problem again
Oppermann, Joerg
Joerg.Oppermann at t-systems.com
Wed Mar 10 09:34:02 CET 2004
Hi Mike,
I retrieve the original HttpServletResponse object and set contenttype and header for it.
Try the following:
CmsJspActionElement cmsjsp = new CmsJspActionElement(pageContext, request, response);
HttpServletResponse resporg = (HttpServletResponse)cmsjsp.getCmsObject().getRequestContext().getResponse().getOriginalResponse();
String strName = "name.pdf";
resporg.setContentType("APPLICATION/PDF");
resporg.setHeader("Content-Disposition","attachment; filename=\""+ strName + "\"");
Regards, Joerg
-----Ursprungliche Nachricht-----
Von: opencms-dev-admin at opencms.org
[mailto:opencms-dev-admin at opencms.org]Im Auftrag von mike
Gesendet: Dienstag, 9. Marz 2004 16:55
An: opencms-dev at opencms.org
Betreff: [opencms-dev] setContentType problem again
The problem has already been described in a posting in the mailing list
by Joerg Oppermann but there has been no solution.
I was trying to set the content-type in a jsp via
response.setContentType ("application/pdf") but the content-type of the
resulting document stayed "text/html". I inspected the
opencms-Sourcecode and found out that the code in the setContentMethod
of CmsFlexResponse has been disabled. Since I am in desperate need to
set the content-type to "application/pdf" for a dynamically created
PDF-document I would like to know if anybody knows a workaround. I am
using opencms 5.0.1.
Thanks
Mike
_______________________________________________
This mail is send to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://mail.opencms.org/mailman/listinfo/opencms-dev
More information about the opencms-dev
mailing list