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?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
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 theHttpSession
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.