[opencms-dev] setContentType problem again

mike opencms at prinz.mailshell.com
Wed Mar 10 17:40:03 CET 2004


Dear Alex,

I tried your suggestion 

  response.setHeader("Content-Type", "application/pdf"); 

but it did not work. But Joerg Oppermann's approach with

  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 + "\"");

seems to work.

Regards 
Mike




More information about the opencms-dev mailing list