views:

49

answers:

1

I'm currently in a need of getting session ID thus I need to get the HttpSession but I don't have any servlets in my EJB module. So perhaps some DI annotation like in webservices api?

+2  A: 

The EJB technology doesn't rely on HTTP so there is absolutely no reason to have HTTP specific stuff in the EJB API. If you need the session id from an EJB (wondering why), pass it as parameter from the web tier (technically, you could even pass the reference to the HttpRequest or the HttpSession objects and read it from the beans but that would be an horrible, wrong, heretic, etc design, EJBs shouldn't have adherences to the Servlet API). You should maybe clarify your requirement.

Pascal Thivent
well lets say javaFX applet is run from web with token value of sessionId and when the applet is used it sends data via rmi to validator EJB module which needs to check this session id.What i did expect is to lookup it in context or inject it or something similar.
Zeratul
I'm saved sessionId to temporary database table when running the applet from web-tier and then i just compare it in EJB from db.
Zeratul