Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How does SessionContext work?

 
J. Adam White
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic