|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.inria.ns.reflex.processor.core.AbstractAction
org.inria.ns.reflex.modules.web.MappingAction
public class MappingAction
The <web:mapping> element defines mapping between URLs and procedures.
A mapping matches an HTTP request if matchesHTTPMethod(HttpServletRequest)
return true AND
getMatcher(HttpServletRequest, DataSet)
return null or a matcher that
matched.
Matcher.matches()| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.inria.ns.reflex.processor.core.AbstractAction |
|---|
AbstractAction.ParameterAdapter, AbstractAction.UselessAction |
| Field Summary |
|---|
| Fields inherited from class org.inria.ns.reflex.processor.core.AbstractAction |
|---|
actions, parent, processorInstance |
| Constructor Summary | |
|---|---|
MappingAction(Pattern matchPattern,
Expression use,
String[] methods,
Node node,
AbstractAction parent)
Creates a new instance of MappingAction. |
|
| Method Summary | |
|---|---|
Matcher |
getMatcher(HttpServletRequest request,
DataSet dataSet)
Return the matcher for the request's URL on this mapping. |
boolean |
matchesHTTPMethod(HttpServletRequest request)
Indicates whether this mapping matches the HTTP method or not. |
void |
setMIMEType(ServletContext context,
HttpServletRequest request,
HttpServletResponse response)
Set the MIME type of the HTTP response according to the extension of the request's URL. |
static AbstractAction |
unmarshal(AbstractAction parent,
Element element)
XML unmarshaller for MappingAction. |
| Methods inherited from class org.inria.ns.reflex.processor.core.AbstractAction |
|---|
addAction, addFallbackAction, createContext, getCanonicalPath, getFallbackAction, getLocalFallbackAction, getLogger, getNamespaceContext, getNode, getParent, recover, recover, removeFallbackAction, reorganize, run, runAction, runActions, toPrettyString, toPrettyString, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MappingAction(Pattern matchPattern,
Expression use,
String[] methods,
Node node,
AbstractAction parent)
MappingAction.
matchPattern - The pattern used to test if an URL matches.
null = matches any.use - The URL material to use for matching.methods - The list of HTTP methods to match.
null = matches any.node - The node from which the action has been unmarshalled. Used for
namespace prefix resolution when performing XPath expressions.parent - The action depending from.| Method Detail |
|---|
public static AbstractAction unmarshal(AbstractAction parent,
Element element)
throws XMLException
MappingAction.
parent - The action depending fromelement - The XML element to unmarshall.
MappingAction created.
XMLException - When the element and its content is not those expected.
public Matcher getMatcher(HttpServletRequest request,
DataSet dataSet)
throws XPathException
Notice that according to the mapping definition, the material specified in the @use attribute will be used for matching instead of the URL, if this attribute is present.
Note : the default URL starts after the application path, and begin with a "/".
request - The HTTP request.dataSet - The data set to use to compute
the material to use for matching.
XPathException - If the material to match can't be evaluated.public boolean matchesHTTPMethod(HttpServletRequest request)
request - The HTTP request.
true if this mapping matches the HTTP request,
false otherwise.
public void setMIMEType(ServletContext context,
HttpServletRequest request,
HttpServletResponse response)
context - The context.request - The HTTP request.response - The HTTP response.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||