Example for CDI-SessionScoped LogIn with TomEE

拈花ヽ惹草 提交于 2019-12-11 14:06:48

问题


i'm currently fighting with TomEE, JSF and CDI (i think).

Is there any example out there which has "@javax.enterprise.context.SessionScoped" annotation using TomEE 1.5.1 (or current snapshot)?

I DONT want to use @ManagedBean or something else from javax.faces, just plain CDI.

My problem is: when i change some @SessionScoped user session instance i end up in having a new sessionID (session fixation problem?!?).

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

Thanks for any help!


回答1:


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 :)




回答2:


I Use TomEE but I don't understand your problem. Do you use the web-profile?

Did you setup beans.xml correctly?

The bugs you linked are unrelated probably your setup. Impossible to say since I don't have anything to go on. Link a sample project I can try or at least paste your bean and tell were you put beans.xml



来源:https://stackoverflow.com/questions/14581666/example-for-cdi-sessionscoped-login-with-tomee

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!