|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cocoon.jxpath.JXPathCocoonContexts
public final class JXPathCocoonContexts
Component that allocate and cache JXPathContexts bound to VariableContext, Cocoon Request, Cocoon Session and Cocoon Context.
If you need to limit the attibute lookup to just one scope, you can use the pre-definded variables "request", "session" and "application". For example, the expression "$session/foo" extracts the value of the session attribute named "foo".
Following are some implementation details. There is a separate JXPathContext for each of the four scopes. These contexts are chained according to the nesting of the scopes. So, the parent of the "variable" JXPathContext is a "request" JXPathContext, whose parent is a "session" JXPathContext (that is if there is a session), whose parent is an "application" context.
Since JXPath chains lookups for variables and extension functions, variables and extension function declared in the outer scopes are also available in the inner scopes.
The "session" variable will be undefined if there is no session for this servlet. JXPath does not automatically create sessions.
Nested Class Summary | |
---|---|
class |
JXPathCocoonContexts.ContextProxy
|
static class |
JXPathCocoonContexts.RequestProxy
|
class |
JXPathCocoonContexts.SessionProxy
|
Field Summary | |
---|---|
static String |
ROLE
|
Constructor Summary | |
---|---|
JXPathCocoonContexts()
|
Method Summary | |
---|---|
void |
contextualize(Context context)
|
org.apache.commons.jxpath.JXPathContext |
getApplicationContext(Context envContext)
Returns a JXPathContext bound to the "application" scope. |
org.apache.commons.jxpath.JXPathContext |
getRequestContext()
Returns a JXPathContext bound to the "request" scope. |
org.apache.commons.jxpath.JXPathContext |
getSessionContext(Session session,
Context envContext)
Returns a JXPathContext bound to the "session" scope. |
org.apache.commons.jxpath.JXPathContext |
getVariableContext()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ROLE
Constructor Detail |
---|
public JXPathCocoonContexts()
Method Detail |
---|
public void contextualize(Context context)
contextualize
in interface Contextualizable
public final org.apache.commons.jxpath.JXPathContext getVariableContext()
public final org.apache.commons.jxpath.JXPathContext getRequestContext()
public final org.apache.commons.jxpath.JXPathContext getSessionContext(Session session, Context envContext)
public final org.apache.commons.jxpath.JXPathContext getApplicationContext(Context envContext)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |