ContentsJava Class DesignRegistering a New Command
Previous: Implementing the Command Interface | Next: Using Variables

Registering a New Command

Any class that implements tcl.lang.Command can be a command, and can be made accessible to the web page designer.  In order to be accessible, a command name needs to be associated with the class by registering it in the servlet's property file.

The servlet which processes WELD files is us.oh.state.common.utility.TemplateProcessor.  This servlet needs to be configured to read a properties file which may contain a number of "command" property assignments.  These assignments map the command name to the class name.  The class is loaded on demand the first time that the command is executed on a page.

This is a fragment of a weld properties file which identifies three commands (now, counter, and include):

# Common commands
command.now=us.oh.state.common.commands.NowCmd
command.counter=us.oh.state.common.commands.CounterCmd
command.include=us.oh.state.common.commands.IncludeCmd

ContentsJava Class DesignRegistering a New Command
Previous: Implementing the Command Interface | Next: Using Variables

Modified: Wed Apr 19 06:58:59 EDT 2000