0

我需要返回一个区域的主体和流响应。

我想更新一个区域并返回一个文件。

java中的事件将是这样的:

Object[] onActionFromGenerar() throws InstanceNotFoundException{
        /**
         * Code
         * 
         */

        try(InputStream input = new ByteArrayInputStream(cuaderno.getFichero())){
            return new Object[] {new AttachmentStreamResponse(input,"Transferencias"), tableZone.getBody()};
        }catch (IOException x){
            System.err.format("IOException: %s%n", x);
            return new Object[] { Index.class } ;
        }
    }

但返回错误。只能返回 tableZone.getBody();

我能怎么做?

4

1 回答 1

3

您不能从单个操作中返回两者。

你需要两个动作。

  1. 第一个操作返回要更新的区域。它还用于JavaScriptSupport.addScript(...)在客户端上的区域更新时加载第二个动作(例如 set window.location.location.href
  2. 第二个动作返回StreamResponse.
于 2013-12-30T12:06:27.553 回答