Pages

Tuesday, January 11, 2011

Importing Java Packages in server-side-script in XPages

In an attempt to use methods in java directly in XPages, I used to try the traditional import methods which would say,

import java.io.*;

 to import the IO.* package in Java and that will always return an error. I was wondering how to do these stuffs untill I stumbled upon a http://www.stevecastledine.com/sc.nsf/dx/using-standard-java-packages-in-your-xpage-code"> post in Steve Castledine's Blog

The proper way to do that in XPages is as follows,

importPackage(java.io)


so in general I assume that to be importPackage(java package name without .*)


Hope this helps :)

1 comment:

  1. Here is the correct link:
    http://www.stevecastledine.com/scastledine/sc.nsf/dx/using-standard-java-packages-in-your-xpage-code

    ReplyDelete