使用TomEE进行CDI-SessionScoped登录的示例 [英] Example for CDI-SessionScoped LogIn with TomEE
问题描述
我目前正在与TomEE,JSF和CDI作战(我认为).
i'm currently fighting with TomEE, JSF and CDI (i think).
有没有使用TomEE 1.5.1(或当前快照)使用"@ javax.enterprise.context.SessionScoped"注释的示例?
Is there any example out there which has "@javax.enterprise.context.SessionScoped" annotation using TomEE 1.5.1 (or current snapshot)?
我不想使用@ManagedBean或javax.faces中的其他内容,只是普通的CDI.
I DONT want to use @ManagedBean or something else from javax.faces, just plain CDI.
我的问题是:当我更改某些@SessionScoped用户会话实例时,我最终将拥有一个新的sessionID(会话固定问题?!?).
My problem is: when i change some @SessionScoped user session instance i end up in having a new sessionID (session fixation problem?!?).
我的用例: 我想在一个页面上进行登录,并且可以从任何地方登录,用户来自JPA层,我不知道是否必须选择该作用域.
My Use-Case: I want to have a login on one page and have the possability to login from anywhere, the user comes from a JPA-layer which scope i don't know exactly if have to choose.
还有另一种方法可以存档吗?!
Is there another way to archieve this?!
我已经掌握了这些页面,但是并没有帮助我
I already got this pages, but didn't helped me out:
http://openejb.979440.n4.nabble.com/guest-user-td4655258i20.html
https://issues.apache.org/jira/browse/TOMEE-734
https://issues.apache.org/jira/browse/TOMEE-745
感谢您的帮助!
推荐答案
很多时间后,我创建了自己的概念验证"示例(与cdi-beans一起使用):
After a lot of time i created my own "proof-of-concept"-example working with cdi-beans:
https://github.com/FibreFoX/cdi-sessionscoped-login
我希望它能对其他人有所帮助,就像它在开发那段很棒的东西时帮助了我一样:)
I hope it will help others, like it helped me while developing that piece of awesome :)
这篇关于使用TomEE进行CDI-SessionScoped登录的示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!