これは、私が実現できていない単純なユースケースです。サーバー メソッド (アクション) を呼び出し、cid
パラメーターを保持せずにページにリダイレクトするリンクまたはボタンを作成したいと考えています。
JSF2、JBoss 7、および Seam 3 を使用しています。
以下に、私が試した 2 つの方法を示しますが、成功しませんでした。
最初のものは、h:commandLink
<h:commandLink action="pages/home.xhtml"
actionListener="#{identity.logout()}"
value="#{bundles.layout.logout}" />
ここでidentity.logout()
は が呼び出されますが、ブラウザは にリダイレクトされるためpages/home.xhtml?cid=1
、再度ログインすると、
org.jboss.weld.context.ContextNotActiveException: WELD-001303 No active contexts for scope type javax.enterprise.context.ConversationScoped
エラー。
二つ目、h:link
<h:link outcome="/pages/home.xhtml" value="#{bundles.layout.logout}">
<f:ajax event="click" listener="#{identity.logout()}" />
</h:link>
ここではcid
、生成されたハイパーリンクには何もありませんが、メソッドidentity.logout()
は呼び出されません...
誰かがアイデアを持っていますか?