title: What class is the return object for facesContext.getExternalContext().getRequest().getSession()?
body: <p>When attempting to the get the Session in SSJS on an XPage (<a href="http://openntf.org/XSnippets.nsf/snippet.xsp?id=get-sessionid-in-ssjs" rel="nofollow">as explained here</a>), the type ahead will only go as far as <code>getSession()</code>.</p>
  
  <p>I can see the <code>getSession()</code> call returns a standard <code>java.lang.Object</code>, which explains why the type ahead beyond <code>getSession()</code> only shows the props/methods for the <code>java.lang.Object</code> class.</p>
  
  <p>However if you continue and call the <code>getId()</code> method, as detailed in the link above, then you can save the XPage and it will run without a problem.</p>
  
  <p>That's fine, but what if I want to make the same call in Java, the code won't compile because, as mentioned above for SSJS, the returned object is a standard <code>java.lang.Object</code> and doesn't have a method called <code>getId()</code>. </p>
  
  <p>Therefore can I cast the returned object to allow me to access the session methods? If so, what class should I cast it to?</p>