Here is a simple usecase which I don't manage to realise : I want to create a link or button which calls a server method (action) and will redirect to a page without preserving the cid
parameter.
I'm using JSF2, JBoss 7 and Seam 3.
Here are two methods I tried without success.
First one, the h:commandLink
<h:commandLink action="pages/home.xhtml"
actionListener="#{identity.logout()}"
value="#{bundles.layout.logout}" />
Here, identity.logout()
is called, but then, the browser is redirected to pages/home.xhtml?cid=1
, so if I login again, I will have an
org.jboss.weld.context.ContextNotActiveException: WELD-001303 No active contexts for scope type javax.enterprise.context.ConversationScoped
error.
Second one, the h:link
<h:link outcome="/pages/home.xhtml" value="#{bundles.layout.logout}">
<f:ajax event="click" listener="#{identity.logout()}" />
</h:link>
Here, I don't have any cid
in the generated hyperlink, but the method identity.logout()
is not called...
Does someone have an idea ?