The document store component is meant for dynamic content. It is conversational, so anything in the document store goes away when the conversation ends. If that works for you, the document store would be a great option.
If your content has a longer lifespan or applies to more than one user, you might take a look at hooking directly into ResourceServlet instead.
I used content servlet used in the seamspace example.
I ship out images through this.
I cant see why you couldn't use it to ship out .pdf.
Can someone point to an example "hooking directly into ResourceServlet instead" as I wouldbe interested in moving over to this method if it preferred.
Look at any of the classes that implement AbstractResource.
Thanks for the reply.
Can you elaborate on the document store? I have searched through the examples and only find the DocumentStore being accessed in components.xml and via the various <p: tags - none of which accept a "filename" parameter that I saw.
Should I access the conversationally scoped documentStore reference in my Java code and make an entry by calling documentStore.saveDate() and manually create the DocumentData object?
How would i then access it on the front-end?
Or am I not on the right track here?
Yes, you should be able to just put the bytes directly into the document store using saveData(). DocumentStore was not really designed with other apps in mind, so it's usage is not documented anywhere. You should look at how it is used in the pdf code to get a feel whether or not it is helpful.
Of course, writing a servlet to dump the data out is pretty simple too. Maybe that is the path of least resistance?