Monday, 12 December 2011

Get Java class names for variables defined in SSJS in XPages


Every global object or variable in SSJS is an object of a class defined in Java. The help documentation says that facesContext is an object of class com.ibm.xsp.domino.context.DominoFacesContext. But what about facesContext.getExternalContext() and other variables?

Well in Java every class inherits directly or indirectly from its base class java.lang.Object. This class has a method named getClass() which returns object of class java.lang.Class (Yes, there is a class called "Class" in Java!). With this you can find out to which class the object belongs, its methods, super class and lot more.

Create a new XPage and add a computed field. Add the code given below for its value and preview it in browser.
Continue reading »

0 comments:

Post a Comment