I have a service that needs to support export to excel, I am using Apache POI for this. Is it possible to pass full control of the response to Java code (need to return a stream with Content-Disposition header)?
Right now it’s not, but we are planning support for this. What you can do right now is to create a javascript controller that delegates to a java class for processing.
The trick here is to let toExcel method on com.foo.bar.ExcelExporter return a guava ByteSource or a byte[] array. This will ensure that the bytes are returned by the controller.
In the future we will support some sort of controller-delegation to Java where you can set headers, body and pageContributions in java.
Now to the next step, I need to be able to accept a excel workbook from form post and pass it into my Java code to update existing content, could you describe how to do that ?
If you want to do this in Java, you can get hold of the HttpServletRequest and MultipartService then get the MultipartForm from that service. See javadoc here: