1. If you do it from an EJB, read the manual and just do it.
2. Otherwise try find a recent post that excelently explained how you bind in an external context. No patched needed, its already there.
Thanks for the response - exactly what I'm looking for (ExternalContextMBean).
note to anyone who hasn't yet bought the doco... its well and truly worth the $10.