📜  StreamedContent primefaces 7 - 任何代码示例

📅  最后修改于: 2022-03-11 14:57:25.755000             🧑  作者: Mango

代码示例1
public StreamedContent getServicesInZip() {
    logger.info("getServicesInZip invoked {}", getUser());

    try {
        InputStream stream = new FileInputStream(BeanUtil.getSfContext().getServiceMarshalManager().packInZip(exportServices()));
        return new DefaultStreamedContent(stream, "application/zip", "Services.zip");
    } catch (FileNotFoundException e) {
        logger.error(e.getMessage(), e);
    }
    return null;
}