public class ClayViewHandlerCommand extends Object implements org.apache.commons.chain.Command
This is a Shale "preprocess" command that should be registered
with the shale chains catalog. It is only need for implementing
full Clay
html or XML views with myfaces.
The myfaces implementation pays strict attention to the javax.faces.DEFAULT_SUFFIX setting,
only allowing viewId's with this suffix. This command will place an indicator in request scope
before the request is processed by the faces servlet. The ClayViewHandler
will use the indicator to determine that the view should be handled by the
ClayViewHandler
.
Constructor and Description |
---|
ClayViewHandlerCommand() |
Modifier and Type | Method and Description |
---|---|
boolean |
execute(org.apache.commons.chain.Context context)
Looks at the request uri to determine if the target page
is a clay template.
|
protected int |
indexOfClayTemplateSuffix(org.apache.commons.chain.Context context)
Checks the
request.uri to determine if it's suffix matches one of
the suffixes . |
public boolean execute(org.apache.commons.chain.Context context) throws Exception
Looks at the request uri to determine if the target page is a clay template. If the request's pathInfo matches the clay template suffixes, a flag is added to the request attributes. This is need for the MyFaces JSF implementation.
execute
in interface org.apache.commons.chain.Command
context
- commons chainstrue
if the chains is finalException
- throws back up the calling stackprotected int indexOfClayTemplateSuffix(org.apache.commons.chain.Context context)
Checks the request.uri
to determine if it's suffix matches one of
the suffixes
. If a match is found, the index into the suffixes
array is returned. A value of -1 is returned if a match is not found.
context
- commons chainssuffixes
Copyright © 2004-2013 Apache Software Foundation. All Rights Reserved.