This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Jun 4, 2013, 12:31 PM
24 Posts
topic has been resolvedResolved

How to use the created java library in an xpage?

  • Category: Other
  • Platform: All
  • Release: 9.0
  • Role: Developer
  • Tags: java libraries
  • Replies: 4
 Hi all,

          I've created a java library i.e a java class and saved it. Its displayed when expanding  'code'  in navigation (In domino designer).

Now, how to use it in the onclick event of a button? 

Pls help. 


Thanks in advance.
Jun 4, 2013, 3:41 PM
366 Posts
Re: How to use the created java library in an xpage?
 In the event that will trigger the Java code (Like the onclick event of a button) use the following SSJS


importPackage(com.compname.packageName);

var jcode:ClassName = new ClassName();

jcode.callMethod();


If the method returns a value then store the return value to a variable. 

that variable can then be used write the value to an XPage component. 
Jun 5, 2013, 4:36 AM
24 Posts
Re: How to use the created java library in an xpage?
 Hi paul,

 I used the default package. 

 so, what package name should be given?


Also, how to use the jar files in the same fashion? 
 
Jun 5, 2013, 2:00 PM
366 Posts
Re: How to use the created java library in an xpage?
 If you are using the default package then omit the package statement and just refer to the class.  Although NOT placing your class in you own package is a REALLY BAD IDEA !!


The code for accessing classes in a jar file is exactly the same. 

 
Jun 6, 2013, 4:53 AM
24 Posts
Re: How to use the created java library in an xpage?
ThankYou so much paul...

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal