Using Java to build applications in the IBM Lotus Domino Designer

Source: Internet
Author: User

This article is designed to help those traditional lotusscript developers turn to Java development. With virtually no Java knowledge, this article can help you start Java application development in IBM Lotus Domino.

Brief introduction

For IBM Lotus Notes application developers, the LotusScript and LotusScript classes are useful when designing a Notes application. The LotusScript API supports programmatic interaction with databases, documents, and even design elements. As Java developed into a mainstream programming language, the more Notes application developers turned their attention to Java.

This article contains three parts: the Java language, examples, and other elements. Java programmers can skip directly to the sample section, but beginners should start reading from the Java language section.

Java language

Published in 1995, Java is an object-oriented programming language, its emergence satisfies the platform independence demand. This is done by compiling the Java source code into bytecode, and then any Java Virtual machine (JVM) on any platform can interpret the byte code.

As a result, any Java application can be run as long as the JVM is implemented for the target platform.

Java's syntax is similar to C, and its object-oriented implementation is similar to C + +, so C + + programmers can easily master Java. However, lotusscript developers may find that Java syntax is very different from lotusscript.

As this article focuses on using Java in Lotus Domino, the examples shown will also be implemented in Lotus Domino's environment.

Let's start with the classic Hello World example. When you create a new Java proxy in Domino Designer, you receive the template code shown in the left column of table 1. The code in the right column has been modified to fit the needs of the "Hello World" sample.

Table 1. Hello World Example

Template Java Proxy Code Hello World Java Proxy code
Import lotus.domino.*;
public class Javaagent extends Agentbase {
public void Notesmain () {
try {
Session session = GetSession ();
Agentcontext agentcontext=
Session.getagentcontext ();

(Your code goes here)

catch (Exception e) {
E.printstacktrace ();
}
}
}

Import lotus.domino.*;
public class Javaagent 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 ();
}
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.