@Get("pdf|excel")
public Representation getReport(Variant variant) {
if(MediaType.APPLICATION_EXCEL.isCompatible(variant.getMediaType()) {
...
}
...}
getVariants().clear();
getVariants().add(new Variant(MediaType.APPLICATION_PDF));
getVariants().add(new Variant(MediaType.APPLICATION_EXCEL));
I wasn’t aware of the Variant
argument behavior in ServerResource
. Where is that documented?
Does it work if you factor into two methods?
@Get("pdf")
public PdfRepresentation getReportPdf() {
...
}
@Get("excel")
public ExcelRepresentation getReportExcel() {
...
}
—tim
--
You received this message because you are subscribed to the Google Groups "Restlet Framework (Discuss)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to framework-disc...@restlet.org.
Hi there,
You should make sure that the metadata service of your parent application has the "pdf" and "excel" extensions properly registered.
By default, I think you should use "xls" instead of "excel".
Best regards,
Jerome
As a recipient of an email from Talend, your contact personal data will be on our systems. Please see our contacts privacy notice at Talend, Inc.
getVariants().add(new Variant(MediaType.APPLICATION_PDF));
getVariants().add(new Variant(MediaType.APPLICATION_EXCEL));