Creating a node in the JCR when a component is rendered
I am creating a component that contains an image-rendering (Java) servlet as part of its implementation. When the component is first rendered, it does not have a node under /content in the JCR, which is preventing the image from loading. What I think is happening is that since I am requesting an image from AEM based on the location of the instance of my component in the JCR, Sling cannot properly find and invoke the servlet, since no node exists with the given selectors.
Specifically: <img src="${resource.path}.image.png?key=123" />
I haven't found a way to automatically create the instance node in the JCR, though I can create the node when I save a new instance configuration to the JCR via the component dialog. Is there some way I can have the instance node be created automatically on component render, or, otherwise, configure something on the server so that I can always make a request that will be successfully routed to my image-rendering servlet?
