Request Scope Attributes

Every request you will need to handle in your templates is preprocessed by the Escenic filter chain (see Servlet Filters), which determines whether it is an article request (a request to view a content item) or a section request (a request to view a section page), and creates a corresponding set of request scope attributes: that is, attributes of the request scope bean, which is called requestScope.

The request scope attributes create by the Escenic filter chain are:

Name/type/full reference Article request Section request
com.escenic.context
String
requestScope['com.escenic.context']

'art'

'sec'

article
PresentationArticle
requestScope['article']

Requested content item

Not present

section
Section
requestScope['section']

Section containing requested content item1

Requested section

pool
PresentationPool
requestScope['pool']

Section page of section containing requested content item1

Section page of requested section

publication
PresentationPublication
requestScope['publication']

Publication containing requested content item

Publication containing requested section

1 "Section containing requested content item" means one of the sections in which the content item appears (usually, the section from which it has been requested), but not necessarily its home section.

The "full references" in the above table show how these attributes can be unambiguously referenced using the JSP expression language. The article request scope attribute, for example, can be referenced as follows:

${requestScope['article']}

and its title field can be accessed as follows:

${requestScope['article'].fields.title}

You can, however, user a more compact notation to access them in most cases. The article request scope attribute can usually be accessed as follows:

${article}

and its title field can be accessed as follows:

${article.fields.title}

This shorter form is the recommended way of accessing the Escenic request scope attributes (referred to in the rest of this manual as the Escenic request beans). Note, however, that you must then make sure you do not create any page scope attributes with the same name as one of the request beans. If you create a page scope attribute with the name article, then

${article}

will return the page scope attribute, and you will have to use the full reference notation to access the request bean.

You should not use the short notation described here to access the escenic.com.context request scope attribute. (You are not allowed to use the "." character in JSP expression language names.) Always use the full reference shown in the table above for this attribute.