Hi!
I have a problem with combining fileDownloadActionListener and BLOB returned by PL/SQL function.
Simply, I have a ADF table with some parameters for function and commandLink in each row. CommandLink calls some Java (getBlob method) to get BLOB (BlobDomain) from PL/SQL function. This part works perfectly.
Next, fileDownloadActionListener should call some method like this:
public void downloadImage(FacesContext facesContext, OutputStream outputStream)
{
BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
// get an ADF attributevalue from the ADF page definitions
AttributeBinding attr = (AttributeBinding) bindings.getControlBinding("getBlob");
if (attr == null)
{
return;
}
// the value is a BlobDomain data type
BlobDomain blob = (BlobDomain) attr.getInputValue();
try
{ // copy hte data from the BlobDomain to the output stream
IOUtils.copy(blob.getInputStream(), outputStream);
// cloase the blob to release the recources
blob.closeInputStream();
// flush the outout stream
outputStream.flush();
}
catch (IOException e)
{
// handle errors
e.printStackTrace();
FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, e.getMessage(), "");
FacesContext.getCurrentInstance().addMessage(null, msg);
}
}
and here is the problem: I get blank page. No errors, just nothing.
I'm not sure what is wrong. Thanks for any help.
I'm runing JDeveloper 11.1.1.6.0