org.apache.cocoon.ajax
Class AjaxRequestSelector
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.selection.AbstractSwitchSelector
org.apache.cocoon.ajax.AjaxRequestSelector
- All Implemented Interfaces:
- LogEnabled, Selector, SwitchSelector, ThreadSafe
- public class AjaxRequestSelector
- extends AbstractSwitchSelector
- implements ThreadSafe
Choose a select branch depending on if the current request is an Ajax request.
The test value can be either "true
" or "false
".
<map:select type="ajax-request">
<map:when test="true">
... ajax request ...
</map:when>
<map:otherwise>
... non ajax request ...
</map:otherwise>
</map:select>
- Since:
- 2.1.8
- Version:
- $Id: AjaxRequestSelector.java 292158 2005-09-28 10:24:51Z sylvain $
Method Summary |
Object |
getSelectorContext(Map objectModel,
Parameters parameters)
Method to create a selector context. |
boolean |
select(String expression,
Object selectorContext)
Selectors test pattern against some objects in a Map
model and signals success with the returned boolean value |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AjaxRequestSelector
public AjaxRequestSelector()
getSelectorContext
public Object getSelectorContext(Map objectModel,
Parameters parameters)
- Description copied from class:
AbstractSwitchSelector
- Method to create a selector context.
- Specified by:
getSelectorContext
in interface SwitchSelector
- Specified by:
getSelectorContext
in class AbstractSwitchSelector
- Parameters:
objectModel
- The Map
containing object of the
calling environment which may be used
to select values to test the expression.parameters
- The sitemap parameters, as specified by
<parameter/> tags.
- Returns:
- selector context
select
public boolean select(String expression,
Object selectorContext)
- Description copied from class:
AbstractSwitchSelector
- Selectors test pattern against some objects in a
Map
model and signals success with the returned boolean value
- Specified by:
select
in interface SwitchSelector
- Specified by:
select
in class AbstractSwitchSelector
- Parameters:
expression
- The expression to test.
- Returns:
- boolean Signals successful test.
Copyright ? 1999-2005 The Apache Software Foundation. All Rights Reserved.