|
JOT Templates > About JOT Tokens
JOT Tokens
JOT Tokens on a template web page refer to server-side Java objects
(JOT Beans, J2EE objects, and POJO's - plain old java objects).
When a JOT Servlet renders a dynamic response
to a client browser request, it replaces each JOT Token with the corresponding
property value of a Java object. For example, an ecommerce site might have
shopping cart JOT Beans and the JOT Tokens on the shopping cart web pages would
display information about the purchased items.
JOT Token Examples:
Render the dynamic value of the LastName JOT Bean property.
JOT.LastName
Render the dynamic value of the AccountId JOT Bean property.
JOT.AccountId
HomePhone is a property of the CustomerInfo object:
JOT.CustomerInfo.HomePhone
A JOT Token with parameters:
JOT.Purchases.SaleDiscount(12.5, JOT.AccountId)
An assignment token sets a property value with the "=" operator.
This example sets the value of the MarkupRate property of the
Purchases object:
JOT.Purchases.MarkupRate=(18.75)
An assignment token with multiple parameters:
JOT.ShoppingCart.InvoiceNumber=(JOT.OrderId, JOT.CustomerName)
A list parameter with the "[]" operator:
JOT.FavoriteThings([Puppies, Fresh Air, JOT.FavoriteSport, JOT.FavoriteSong])
Notes:
-
Combining Strings:
JOT Tokens and other text are concatenated (combined) by placing
them together with no separating spaces. Empty parentheses
mark the end of a JOT Token that has immediately following text.
Examples:
JOT.ShoppingCart.Title=(Shopping Cart for JOT.CustomerName)
sometextJOT.Foo()moretextJOT.Bar(batz)JOT.foo2 endtext
JOT.FooBar(JOT.abc" sometext "JOT.xyz()endarg1, arg2)
-
Quoted Text:
Single or double quotation marks around a parameter preserve
leading and trailing blanks. Quotation marks also hide commas
(that would otherwise start the next parameter) and allow closing
parentheses and list brackets to be treated as text. A backslash
inside quoted text preserves an embedded quotation mark. In this
example the first parameter to FooBar is a long string containing
parentheses, commas, and quotation marks:
JOT.FooBar(" arg1 text is (blah), and more \"blah\", blah ", arg2)
|