Sun Java System Web Server 6.1 SP12 Programmer's Guide to Web Applications

<Search>

Function

Executes a search query and returns search results. The search tag retrieves a query string and collection(s) from either a form parent tag or the query and collection attributes. The search results are saved in the page context with a page or session scope.

Attributes

formId. Specifies the name of the form used for the search. The default form will be used if the attribute is left empty. If this tag is used without a form, this attribute must be set to provide an identifier for the resultIterate tag.

Collection. (optional) A comma-delimited string representing collection(s) used for a search. If there is a form action, this attribute is ignored and the values are retrieved by requesting the collection element.

Query. (optional) Specifies the query text. If not provided, it is retrieved from the query element.

Scope. Specifies an integer indicating the scope of the search results. The value 1, which is the default, indicates page scope, and 2 indicates session scope.

Usage

<s1ws:search >

This search tag uses the default parameters and executes a search. The search results will be saved in pageContext with a page scope.

<s1ws:search Collection="col1, col2" Query="Java Web Service" scope="2" >

This search tag will execute a search in col1 and col2 using "Java Web Service" as the query string. The search results will be saved in pageContext with a session scope.