1

I have two questions:

  • Is it good approach to get http session information in ejb?
  • How can i get Http Session information in EJB tier?

Context

I have application in which I have two types of pages, jsp pages and jsf pages, now am getting session information in jsp page and i want to pass this session information to jsf backing bean because from backing bean am calling ejbs and needs session for setting up all remote and local interfaces for ejb.

Rachel
  • 100,387
  • 116
  • 269
  • 365

2 Answers2

0

No, especially since EJB's aren't usually invoked over HTTP.

jtahlborn
  • 52,909
  • 5
  • 76
  • 118
0

HTTP Session information cannot be availed from EJB's readily. However, Session being Session, you should be able to retrieve values from it, irrespective of it being a JSP or a JSF.

To retrieve a Session attribute in JSF by doing

<h:outputText value="#{sessionScope['id']}" />  
Pradeep Pati
  • 5,779
  • 3
  • 29
  • 43
  • More info at http://stackoverflow.com/questions/550448/get-request-and-session-parameters-and-attributes-from-jsf-pages – Pradeep Pati Oct 05 '12 at 18:00