Hello World Program in ATG

Hello World Program in ATG
[Here ITS - is the project name]

File:# 1  WelcomeDroplet.java

package com.its;
import atg.nucleus.GenericService;
import atg.nucleus.ServiceException;
import javax.servlet.ServletException;

import atg.servlet.DynamoServlet;
import atg.servlet.DynamoHttpServletRequest;
import atg.servlet.DynamoHttpServletResponse;
import javax.servlet.ServletOutputStream;

import java.io.IOException;

public class WelcomeDroplet extends DynamoServlet{
String name;
public void service (DynamoHttpServletRequest request, DynamoHttpServletResponse response) throws ServletException, IOException {
ServletOutputStream out = response.getOutputStream();
out.println ("Hello World! My name is "+name);
catch (Exception e)
System.out.println("You are printing: "+name);
public String getName () { return name; }

public void setName (String name) {
System.out.println ("setting name attribute to " + name);
this.name = name;

File:#2   WelcomeDroplet.properties

name=Hello World

File:#3  hello.jsp


<dsp:droplet name="its/WelcomeDroplet">
<dsp:oparam name="output">
<dsp:valueof param="WelcomeDroplet.name"/>

After saving all files, follow the following steps

Step:#1 Build Files
cd /opt/dev_server/ITS/build-files
ant -Dserver=store
Step:#2 Deploy
cd /opt/dev_server/ITS/build-files/dev-deployment-specific-files
Step:#3 Store log
cd /opt/dev_server/ITS/build-files/dev-deployment-specific-files
nohup ./startStoreServerOnJBoss.sh > store.log &
tail -f store.log

The output will be:

Hello World! My name is Hello World

Verify droplet by search in component



In the name row you can see the text as “Welcome”. By clicking on “name” you can change the value.

Popular posts from this blog

[Solved] Hive installation error: java.net.URISyntaxException: Relative path in absolute URI

Install Android SDK in centOs

Installing arules package (Association Rules) in R