TagLib: Mail

fetch

Description

This tag builds a collection of the type specified by the collection attribute.

The Mail collections may be considered in the following fashion:

  • A user possesses a collection of "folders".
  • A folder possesses a collection of "messages".
  • A message possesses a collection of "lines".
A fetch of any given collection type creates a "current" collection of that type, e.g., a fetch of a "messages" collection creates the current "messages" collection. These "current" collections are associated with the current Mail context.

If an error occurs during processing, the tag body will be evaluated and the remainder of the page will be skipped.

Tag Body

JSP

Restrictions

n/a

Attributes

The tag has the following attributes:  

Attribute

Description

Req'd?

collection Identifies the type of collection to fetch. Yes
id Identifies which collection to fetch. See below
sb Indicates which "field" to sort by. See below
sd Indicates which direction to sort. See below
  • If collection is "folders":
    • id is ignored.
    • sb is ignored.
    • sd may be "up" or "down".
  • If collection is "messages":
    • id identifies from which folder to fetch the messages.
    • sb identifies by which message field to sort by.
    • sd may be "up" or "down".
  • If collection is "lines":
    • id identifies which message to fetch.
    • sb is ignored.
    • sd is ignored.
    A fetch of a "lines" collection assumes that id refers to a message within a "messages" collection that was fetched previously, using the same mail context.

Properties


Example(s)

<%-- example of fetch tag --%>
<mail:context/>
...
<mail:fetch collection="messages" id="INBOX" sb="date" sd="down">
<p>Fail.
</mail:fetch>
...
<mail:fetch collection="lines" id="0">
<p>Fail.
</mail:fetch>
...
<mail:lines>
  <mail:line>
    <mail:get property="text"/>
  </mail:line>
</mail:lines>