The following is a list of some of the API functions used by ATG Servlet Beans and other Nucleus components. For more information, see the descriptions of the atg.droplet and atg.nucleus packages in the Dynamo API Reference.

getX ()

In a Nucleus component, this defines a property X that may be read by the <valueof bean=...> or "bean:..." constructs. The method must be declared public and should take no arguments.

public String getName ();

Defines a property called name.

setX ()

In a Nucleus component, this defines a property X whose value may be set. The method must be declared public, should take a single argument (of the type returned by the corresponding getX) method, and should return void.

public void setName (String name);
handleX ()

In a Nucleus component, this defines a handler for a particular property referenced in a form. The method is called after the setX method (if any). It is usually hooked up to submit buttons, and usually the only method called from request or response is request.sendRedirect ().

public boolean handleX (javax.servlet.http.HttpServletRequest request,
                        javax.servlet.http.HttpServletResponse response)
  [throws java.io.IOException, javax.servlet.ServletException]

If the method does a redirect, it must return false, otherwise it must return true.

Typical ATG Servlet Bean Signature

A typical ATG Servlet Bean extends atg.servlet.DynamoServlet, and implements the following method:

public void service (DynamoHttpServletRequest request,
                     DynamoHttpServletResponse response)
     throws ServletException, IOException
{
   ServletOutputStream out = request.getOutputStream ();
}
DynamoHttpServletRequest.getParameter ()

Retrieves the String value of a parameter, null if the parameter is not defined:

String pval = request.getParameter ("storename");

This only works for parameters with String values.

DynamoHttpServletRequest.getLocalParameter ()

Retrieves the value of a locally defined parameter. Parameter is defined within the current DSB or at the top level of the DSB.

String pval = request.getLocalParameter ("storename");
DynamoHttpServletRequest.getObjectParameter ()

Retrieves the Object value of a parameter, null if the parameter is not defined:

Intger ival = (Integer) request.getObjectParameter ("count");
DynamoHttpServletRequest.setParameter ()

Sets the value of a parameter, making that parameter visible to other elements rendered by the DSB:

request.setParameter ("count", new Integer (17));
DynamoHttpServletRequest.serviceParameter ()

Displays the value of a parameter. Works for parameters of any type, including open parameters and non-String parameters.

request.serviceParameter ("storename", request, response);
DynamoHttpServletRequest.serviceLocalParameter ()

Displays the value of a locally defined parameter. Parameter is defined within the current DSB or at the top level of the DSB. Works for parameters of any type, including open parameters and non-String parameters.

request.serviceLocalParameter ("storename", request, response);
DynamoHttpServletRequest.resolveName (String name)

Resolves a name to a Nucleus component by searching the session, global, and request namespaces. Returns null if the component could not be found or created.

Scheduler s = (Scheduler)
  request.resolveName ("/services/scheduler/Scheduler");
 
loading table of contents...