Tag Library Definition


ad:page

Outermost tag that should enclose every ACS Java page. Creates a Database object (db) and an AdSet (form) initialized with the passed-in URL or form variables.

ad:header

Prints out page header in a uniform fashion, with a page title enclosed within the header tags.

ad:footer

Prints out page footer in a uniform fashion.

ad:get_user_info

Attributes:
Sets UserInfo into scripting variable specified by id. Redirects to registration page if user is not logged in and redirect is true (default).

ad:datasource

Attributes:
instantiates a datasource (deprecated)

ad:db_transaction

The enclosed code is executed as a database transaction.

ad:string

Attributes:
Return contents of string tag into scripting variable, whose name is specified by id.

ad:db_string

Attributes:
Take the enclosed SQL query, and outputs the first column of the first row returned.

ad:db_bind

Attributes:
Bind value to surrounding SQL statement. Bind value is body of tag, or the value of the pageContext attribute named by var. Values are normally bound in the order of bind variables, but the "name" attribute may be specified to associate a value with a specific named bind variable (e.g., :group_id) out-of-order.

ad:db_query

Attributes:
Create a Selection object from the result of the enclosed SQL query. Following this tag, the SqlStatement object representing the query is available through the variable specified by id; the Selection object is available through the variable specified by obj. The type attribute may be used to indicate that a particular subclass of Selection should be used instead. The returned Selection object is available both as a variable and as request and pageContext attributes.

ad:db_foreach

Attributes:
Iterate over rows of a SQL query, making rows available as a ResultSet. Deprecated: use ad:loop instead.

ad:db_1row

Attributes:
Special case of db_query for a single-row query. Default subclass of created object is SingleSelection if type not supplied.

ad:db_0or1row

Attributes:
Same as db_1row, but doesn't generate an error if no rows. Created Selection object is null if no rows.

ad:if_no_rows

Specify content to write if db_foreach or db_0or1row turns up no rows.

ad:page_contract

Attributes:
Tag to process and type-check form/URL variables, specified through the vars attribute. For each declared variable, a scripting variable is declared and initialized with the value passed in from the HTTP request.

If the "id" attribute is supplied, an object of type PageContractTag is created with the indicated name; the addComplaint() method is used for adding validation errors, and the closing /page_contract tag will display an error message to the user including the complaints.

ad:template_contract

Attributes:
Contract for declaring the request attributes that must be passed into a TPL template from a JSP file calling the use_template tag. Format is template_contract vars="var1[:flag1,flag2] var2[:flag]", where flags can be: datasource (indicates some type of DataSource), or class=ClassName (to specify a class). Default type for each attribute is String.

ad:use_template

Attributes:
Includes a template for displaying the requested page. Passes control to a corresponding TPL file; if the calling JSP is /path/to/page.jsp, the template loaded is /templates/path/to/page.tpl. TPL files are just JSP files with a different extension. The "method" attribute indicates the method of request passing: forward or include (default is forward).

ad:loop

Attributes:
Includes a template for looping over DataSource objects. The code or HTML between loop tags is printed or executed once for each element in the DataSource.

ad:scope

Attributes:
Define a scope for the sub tag. The "sources" attribute is a list of datasources declared in the template contract to search from enclosed ad:sub tags.

ad:loop_empty

Used to display text if and only if a preceding ad:loop contained no data

ad:sub

Attributes:
Used to fetch out values from a datasource within enclosing scope or loop tag. The "var" attribute indicates the key or column name to fetch; a datasource may be explicitly supplied with the "ds" attribut, and the "encode" attribute (default "false") indicates if the output is to be URL-encoded.

Note: the ad:sub tag will introspect into the object and look for a more method that corresponds to the property name before calling the general get(key) method. <ad:sub var="column_name"/> will first try to call getColumnName() if it exists on the datasource; otherwise it will call get("column_name") if no such method exists.

ad:export

Attributes:
export URL or Form vars from a datasource object.

ad:memoize

Attributes:
wrapper to MemoizeCache