SearchAction
This is the component that does the actual search. The Search Action component will work with different Action forms. The only requirement is that all action forms are an instance of the Search Form class.
To provide a simple and an advanced search will you need to configure the SearchAction class twice in struts-config.xml. One for each form you will use.
Struts config
<action path="/search/simple" type="com.escenic.search.SearchAction" name="simpleSearchForm" input="/search/simple-input.jsp" validate="true"> <forward name="success" path="/search/simple-success.jsp"/> </action>
Action Form
Below is a list of the Action Forms known to work with this Action. All of these Action Forms is a instance of SearchForm.
com.escenic.search.SearchForm
-
This is the Abstract Super class for all SearchForms.
com.escenic.search.SimpleSearchForm
-
Use this Action Form when you want to create a simple search.
com.escenic.search.AdvancedSearchForm
-
Use this Action Form when you want to create a advanced search.
Action Forwards
This is a list of the action forwards used by this Action.
- input page
-
When an error or something that requires the system to give the user a message, is the input parameter used. This forward can be overridden by providing a value for the 'input' property on the Action Form.
success
-
This forward is used when we have a result to display. Even a empty result is a result. This forward can be overridden by providing a value for the 'result' property on the Action Form.
Request attribute
The following request attributes are made available on the forwarded page.
result
-
This attribute is of type
com.escenic.search.ResultPage
. The list of hits for this search.
Action Error
This is a list of the errors that can be created by this action.
errors.form
-
(On the
ActionErrors.GLOBAL_ERROR
property.) When the Action Form provided is of the wrong type. {0} represents the provided Action Form, {1} the expected type.