I think I am onto something.
When I add the following "xls" entry to web-scripts-application-context.xml (should really change this to an extension).
<!– Default set of API Formats –>
<bean id="webscripts.formats" parent="webscripts.formatmap">
<property name="formats">
<props>
<prop key="html">text/html</prop>
<prop key="text">text/plain</prop>
<prop key="xml">text/xml</prop>
<prop key="atom">application/atom+xml</prop>
<prop key="rss">application/rss+xml</prop>
<prop key="json">application/json</prop>
<prop key="opensearchdescription">application/opensearchdescription+xml</prop>
<prop key="mediawiki">text/plain</prop>
<prop key="portlet">text/html</prop>
<prop key="xls">application/msexcel</prop>
</props>
</property>
</bean>
My template file has a name format like: reports.get.xls.ftl
And in the related .desc file I have the following entry:
<format default="xls">extension</format>
After restarting the appserver and clicking on the webscript URL, FireFox opens a box to ask me whether to save or search for an application.
When I point FireFox to use MS Excel, I can choose for FireFox to always use that application.
So this looks like it, but not quite. It's elaborate and although most of the times the end-user needs to "format" the columns in excel, it should be possible
to have a SaveAs "export.xls" dialogbox.
Regards,
Alex