HI ALL
How to retain the login credentials once logged in to
ejb container from servlet container.To be precise can I invoke the HttpSession/HttpeRequest Objects from a EJB Container.
Thanks
-
HttpSession invocation from EjbContext (2 messages)
- Posted by: Atanu Pram
- Posted on: March 25 2004 17:48 EST
Threaded Messages (2)
- HttpSession invocation from EjbContext by Paul Strack on March 25 2004 23:33 EST
- HttpSession invocation from EjbContext by joseph antony on March 27 2004 05:07 EST
-
HttpSession invocation from EjbContext[ Go to top ]
- Posted by: Paul Strack
- Posted on: March 25 2004 23:33 EST
- in response to Atanu Pram
Assuming everything is all in one server, login credentials (user credentials and permisssions) should propogate automatically from the web layer to the EJB layer.
However, the HttpServletRequest and HttpSession do not propagate. You could, in theory, pass them as method parameters to your EJBs, but this is a really, really bad idea. All this does is tightly tie your EJBs to your web layer, and can break in any number of unpleasant ways.
A much better idea is to retrieve the data from your request and/or session, and pass the data values to your EJBs. The data values (just strings and normal java objects) will be independent of your web layer. This will maintain proper separation between your application layers. -
HttpSession invocation from EjbContext[ Go to top ]
- Posted by: joseph antony
- Posted on: March 27 2004 05:07 EST
- in response to Atanu Pram
HI ALLHow to retain the login credentials once logged in to ejb container from servlet container.To be precise can I invoke the HttpSession/HttpeRequest Objects from a EJB Container.Thanks
if u r using appserver for login...(means u have created users and roles in appserver)
u can use
sessionContext.getCallerPrincipal().getName()
to retrieve the login name
regards
joseph