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,


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

Hope this helps :)


  1. Here is the correct link:

  2. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Java developer learn from Java Training in Chennai. or learn thru Java Online Training from India . Nowadays Java has tons of job opportunities on various vertical industry.