Sun Java System Application Server Platform Edition 8.1 2005Q2 Update 2 Developer's Guide

- Previous: consistency
- Next: constraint-field-value

## constraint-field

Specifies a cacheability constraint for the given url-pattern or servlet-name.

All `constraint-field` constraints must pass for a response to be cached. If there are `value` constraints, at least one of them must pass.

### Superelements

cache-mapping (`sun-web.xml`)

### Subelements

The following table describes subelements for the `constraint-field` element.

Table A–31 `constraint-field` Subelements

Element | Required | Description
--- | --- | ---
constraint-field-value | zero or more | Contains a value to be matched to the input parameter value.

### Attributes

The following table describes attributes for the `constraint-field` element.

Table A–32 `constraint-field` Attributes

Attribute | Default | Description
--- | --- | ---
`name` | none | Specifies the input parameter name.
`scope` | `request.parameter` | (optional) Specifies the scope from which the input parameter is retrieved. Allowed values are `context.attribute`, `request.header`, `request.parameter`, `request.cookie`, `request.attribute`, and `session.attribute`.
`cache-on-match` | `true` | (optional) If `true`, caches the response if matching succeeds. Overrides the same attribute in a constraint-field-value subelement.
`cache-on-match-failure` | `false` | (optional) If `true`, caches the response if matching fails. Overrides the same attribute in a constraint-field-value subelement.

- Previous: consistency
- Next: constraint-field-value

- © 2010, Oracle Corporation and/or its affiliates