aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes How does SessionContext work? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "How does SessionContext work?" Watch "How does SessionContext work?" New topic
Author

How does SessionContext work?

J. Adam White
Greenhorn

Joined: Jan 31, 2005
Posts: 16
All,

Is the SessionContext a specialized version of Context (or InitialContext)?

If I put an environmental variable called "myVariable" into the ejb-jar.xml, I can access this value by looking up java:comp/env/myVariable. If instead I choose not to include this variable in the ejb-jar file but instead bind it to the jndi tree, could this variable still be available using java:comp/env/myVariable?

Regards,

Joshua
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
The SessionContext and javax.naming.Context classes are two completely different beasts. SessionContext has nothing to do with JNDI. ENC variables (i.e. java:comp/env/blah) will always be access via JNDI. The SessionContext is only capable of doing exactly what its interface defines.


Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How does SessionContext work?