IBM®
Skip to main content
    Country/region [select]      Terms of use
 
 
    
     Home      Products      Services & solutions      Support & downloads      My account     
 
developerworks > Dashboard > IBM Lotus Domino Web Application Development > ... > Java primer > Working with Java in Domino Designer
developerWorks
Log In   View a printable version of the current page.
Overview Spaces Forums Blogs Podcasts Wikis Exchange
Working with Java in Domino Designer
Added by schenkew@us.ibm.com, last edited by jservais on Apr 03, 2008  (view change)
Labels: 
(None)

 This is a community wiki. Be sure you are logged in to edit, comment, and add pages. Not a member yet? It's free and simple. Click Login in the upper right corner and Register.
View a PDF of the original wiki content produced in March 2008 by Lotus and IBM Redbooks.
Table of contents | Previous | Next

Domino Designer is essentially an IDE. The following example shows how HelloWorld looks in Domino.

import lotus.domino.*;

public class HelloWorld extends AgentBase {

	public void NotesMain() {

		try {
			Session session = getSession();
			AgentContext agentContext = session.getAgentContext();

			// (Your code goes here)
			System.out.println ("Hello world!");

		} catch(Exception e) {
			e.printStackTrace();
		}
	}
}

In this example, you might notice the following items:

  • Domino Designer has included an import statement to include its domino classes and object model. These Domino classes essentially map out to equivalent classes in Lotus script.
  • The default class name for a new Java agent is JavaAgent. In this case, we have changed it to HelloWorld. After the agent is saved, it is included in the Domino Database that has HelloWorld.java, and is suitable for export if necessary.
  • The standard agent or application entry point is NotesMain
  • Domino Designer inserts two lines of code to establish a Notes session to run the agent.
  • A catch statement is automatically inserted to catch any errors reported to the JVM.

In the Domino Designer, our example is displayed in the agent window as shown in the following figure.

Java image



In addition to using Java in notes agents, Java can also be included in a Domino Database as a Java Library. This give added flexibility in developing shared codes and applets.


    About IBM Privacy Contact