2012-01-10 1 views
0

내가 알지 못하는 간단한 사용법은 다음과 같습니다. 서버 메소드 (작업)를 호출하고 cid 매개 변수를 보존하지 않고 페이지로 리디렉션하는 링크 또는 버튼을 만들고 싶습니다. 내가 JSF2, 보스 7 솔기 3. 다음조치를 호출하고 시드를 보존하지 않는 링크 또는 단추를 작성하는 방법은 무엇입니까?

을 사용하고

내가 성공하지 않고 노력하는 두 가지 방법입니다. 먼저 하나

, 여기 h:commandLink

<h:commandLink action="pages/home.xhtml" 
       actionListener="#{identity.logout()}" 
       value="#{bundles.layout.logout}" /> 

내가 다시 로그인하면, 내가

org.jboss.weld.context.ContextNotActiveException: WELD-001303 No active contexts for scope type javax.enterprise.context.ConversationScoped 
을 가지게됩니다, identity.logout()가 호출됩니다,하지만, 브라우저는 pages/home.xhtml?cid=1로 재

오류. 두 번째

, 여기 h:link

<h:link outcome="/pages/home.xhtml" value="#{bundles.layout.logout}"> 
    <f:ajax event="click" listener="#{identity.logout()}" /> 
</h:link> 

, 내가 생성 된 하이퍼 링크의 모든 cid을 가지고 있지 않지만,이 방법 identity.logout()가 호출되지 않습니다 ...

누군가가이 있습니까 아이디어?

답변

0

h:commandLink을 사용하고 conversation.end()identity.logout()에서 불러 와야합니다. identity.logout() 코드를 포함시키지 않았지만 대화를 끝내지 않을 것으로 생각됩니다. 대화를 끝내면 장기 실행에서 일시적으로 변경되며,이 시점에서 대화가 전파되어서는 안됩니다.

+0

'identity.logout()'의 코드는 [Seam의 3 보안 모듈] (https://github.com/seam/security/blob/release/3.1.0.Final/impl/src/main/java)입니다. /org/jboss/seam/security/IdentityImpl.java#L420). 그것은'conversation.end()'를 호출하지 않고'session.invalidate()'를 호출합니다. 게다가,'conversation.end()'를 호출하는'PostLoggedOutEvent' 옵저버를 만들었지 만, 더 나은 것은 없습니다 : 여전히'pages/home.xhtml? cid = X'로 리다이렉트합니다.'X'는 이전의 대화 ID입니다. 로그 아웃. –

관련 문제