This couldn't be that hard, could it?
At least I have a hard time explaining to my boss why it's not that easy:
When a user logs in to our application, he chooses one of several companies to work with. A company entity has an associated image that I can retrieve from the DB just well.
Now how can I deliver that image, so that it can be used in jsp/html, for example in "" ?
I tried writing a servlet, but from there I don't have access to the seam context that contains the current company.
I tried writing a jsf page that contains inline code that calls a method that appends the data to the out stream. That sort of works, but I get lots of ugly errors in the log (like "response.getOutputStream() has already been called").
I set parameters in the url that provides the servlet with the information needed to identify which image the servlet should output.
Although, I would think that you could do a priority search by using Contexts.lookupInStatefulContexts() or something similar.