Jeff Marshall wrote:
> I am trying to sent the content type in a portlet doExcelselect method
> using :
> <<<
> MimeType mt = new MimeType("application/vnd.ms-excel");
> // rundata.setContentType( mt.getContentType() );
> // rundata.setCharSet( mt.getCharSet() );
> rundata.setContentType("application/vnd.ms-excel");
> //
> rundata.getResponse().setContentType("application/vnd.ms-excel");
> VelocityPortlet portlet =
> (VelocityPortlet)context.get("portlet");
> Log.debug("portlet supports type "+portlet.supportsType(mt));
>
> // implementation junk
>
> // just before return
> Log.debug("doExcelselect content type is
> "+rundata.getContentType());
>
> The portlet.supportsType() returns true, and the last debug
> rundata.getContentType() returns application/vnd.ms-excel.
>
> Does this logic work?
The problem is that typically a portlet is shown together with a set of
other portlets, and (in jetspeed's current implementation) also inside a
Turbine page, with navigations. All of this code should work with the
same markup type.
To achieve this, you will need to specify your page to use a "blank"
layout, with no navigations, and a portlet without title or other
decoration.
In current Jetspeed code, ContentType is set in the JetspeedVelocityPage
and JetspeedLayout code, according to the CapabilityMap.
>
> The idea is to build an html table, set the content type to
> application/vnd.ms-excel, and let the browser show the spreadsheet
> (I.E) or ask for an application (Netscape).
The "text/tab-separated-values" IANA Media type could be better suited
for this purpose, but I wonder is Excel would support it appropriately
without reconfiguration.
>
> This works in other (non-Jetspeed) servlets, and I am wondering if
> anyone has had success with this, or something like it.
>
> Thanks
> Jeff
>
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>