I can't see any help, so because I found the solution I would like to
share with you:
public class PDFResource extends DynamicWebResource{
........
}
And this snipet to put into an action:
IResourceStream resourceStream = new PDFResource
(bean).getResourceStream();
getRequestCycle().setRequestTarget( new ResourceStreamRequestTarget
(resourceStream) {
public String getFileName() {
return bean.getNumber() + ".pdf"; } });
Actually the solution I found originally was:
IResourceStream resourceStream = new ByteArrayResourceStream(pdf,
"application/pdf");
where pdf is an array of bytes
byte[] pdf = ...;
but I couldn't find ByteArrayResourceStream class.
Does anybody know where I can find it?