Hi,
I'm having trouble setting up an a:mediaOutput tag to play a sound with a PAGE scoped bean to back it up. The sound plays fine but the bean is created multiple times, which is incompatible with the page logic since values are not being persisted beyond the request.
I've seen related topics regarding the CONVERSATION SCOPE but none using PAGE. Is it possible to use a:mediaOutput with a PAGE scoped bean?
Here is the source for the files involved (only related logic to improve readability).
Page.xhtml:
... <a:mediaOutput id="sound" rendered="true" session="true" element="object" mimeType="audio/x-wav" createContent="#{bean.play}" value="#{bean.filename}" cacheable="false" style="width:0px;height:0px;" > <s:conversationId value="#{conversation.id}"/> </a:mediaOutput> ...
Bean.java:
... @Name("bean") @Scope(ScopeType.PAGE) public class Bean implements Serializable { @Logger private Log log; @Create public void start() { log.info("Start"); // <other stuff> } ... public synchronized void play(OutputStream stream, Object object) throws IOException { ... } }
The
<s:conversationId/>
Any help? Thanks.
Yoel
I have the same problem. I have a page scoped seam component and every mediaOutput create new instance of the page component. There is any solution like s:conversationId but for page scope?