If you don't need a specific object type and are using Velocity 1.5, you can just use the new map syntax to create a map that you can add properties to.
#set( $personnelRecord = { 'name' : "...", 'rank' : "...", 'serialNumber' : "..." } ) if you need to create a specific object, i'd recommend creating a tool that instantiates new ones for you on demand and putting that tool in the context. #set( $personnelRecord = $myRecordMaker.createNewPersonnelRecord() ) On 12/13/06, Gary M. Catlin <[EMAIL PROTECTED]> wrote:
How do I go about defining an object that possesses several properties, so that the object may later be added to a list as follows: #set ($roster = []) #set ($personnelRecord.name = "...") #set ($personnelRecord.rank = "...") #set ($personnelRecord.serialNumber = "...") #set ($n = $roster.add($personnelRecord)) Obviously, I would be adding multiple records to "$roster" for later retrieval. TIA --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]