Quantcast
Channel: PTC Community: Message List - Windchill
Viewing all articles
Browse latest Browse all 8876

Re: IllegalAccessError while accessing sessionContext object.

$
0
0

If what you want is the user name associated with the current method context, then the code snippet I gave should work as well.

 

SessionContext.getContext() is supported, but do note what the Javadoc says:

 

"Get current session context. Session context is determined by authentication information in the current Method context. If none exists, an unauthenticated session context will be established."

 

If you don't want the italicized piece to occur, then I'd go with "MethodContext.getContext().mbean.getUserName()" instead.  If the method context will have an associated user by this point, then either approach should work just fine.


Viewing all articles
Browse latest Browse all 8876

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>