No problem for a big size, mediaOutput component generate content in a separate request.
If you have a big pdf files, set the 'cacheable' attribute to 'false', to avoid store generated content in the server-side cache.
On other hand, you can setup cache to use file storage ( put in classpath oscache.properties file, and follow instructions on oscache.properties ).
Thanks Alex, that's great. Finally I ended my long search for a multimedia component avoiding that old dirty trick of writing directly on the response stream.
One more question, though: is the attribute "value" mandatory ? For blob rendering all I need is "createContent" which binds to a bean method. Such bean is presumed to know what to do, writing data to the passed stream. Why "value" in this game ? Can I skip it ?
value similar to parameter of the method. It is available in the createContent. Why not use value to pass a name of the pdf you want to create for example?
if 'cacheable' attribute set to true (by default), the same value for different calls causes taking resource from the cache instead of invoking "createContent".
P.S. a4j:mediaOutput has two parameters - data and value. value is an alias for data. So, if you use data, no reason to use value and visa versa.
I can't find any "data" attribute in dev. guide description of mediaOutput.
Maybe it's a bit misaligned, and on the other hand it says "IMPORTANT: Since serialized data stored in URI, avoid using big objects".
I'm very surprised that I couldn't find around any JSF component library capable of generating a HTML chunk like this:
or alike using . It's likely I miss some point, though.
Oops, html was stripped. I meant "object data="/filename.pdf" type='application/pdf' ". Looks so simple.
Would you tell me please which element attribute you used to display pdf.
I have tried object, the html output is generated but nothing appear.
I Have notice that even with html, the object does not appear if width and height attributes are not set.
The mediaOutput Component does not generate those attributes.
I'm wondering if meanwhile anyone in here successfully uses this medaoutput for pdf generation, and if yes, how exactly (source would be best).
Many Thanks & Greetings, Max
You told you are sucessful using some tag, but could tell what tag is that and how you resolved the issue, Because i am having the same trouble and its not even call the underlying method