@MetaInfServices(value=Facet.class) public class JellyFacet extends Facet implements JellyCompatibleFacet
Facet
that adds Jelly as the view.Modifier and Type | Field and Description |
---|---|
ResourceBundleFactory |
resourceBundleFactory
Used to load
ResourceBundle s. |
ScriptInvoker |
scriptInvoker
Used to invoke Jelly script.
|
static boolean |
TRACE
This flag will activate the Jelly evaluation trace.
|
Constructor and Description |
---|
JellyFacet() |
Modifier and Type | Method and Description |
---|---|
void |
buildViewDispatchers(MetaClass owner,
java.util.List<Dispatcher> dispatchers)
Adds
Dispatcher s that look at one token and binds that
to the views associated with the 'it' object. |
javax.servlet.RequestDispatcher |
createRequestDispatcher(RequestImpl request,
Klass<?> type,
java.lang.Object it,
java.lang.String viewName)
Creates a
RequestDispatcher that handles the given view, or
return null if no such view was found. |
java.util.Collection<java.lang.Class<JellyClassTearOff>> |
getClassTearOffTypes() |
java.util.Collection<java.lang.String> |
getScriptExtensions()
Gets the list of view script extensions, such as ".jelly".
|
boolean |
handleIndexRequest(RequestImpl req,
ResponseImpl rsp,
java.lang.Object node,
MetaClass nodeMetaClass)
Attempts to route the HTTP request to the 'index' page of the 'it' object.
|
static void |
setExpressionFactory(javax.servlet.ServletContextEvent event,
org.apache.commons.jelly.expression.ExpressionFactory factory)
Sets the Jelly
ExpressionFactory to be used to parse views. |
buildFallbackDispatchers, createRequestDispatcher, discover, discoverExtensions, getKlass
public volatile ScriptInvoker scriptInvoker
public volatile ResourceBundleFactory resourceBundleFactory
ResourceBundle
s.public static boolean TRACE
public void buildViewDispatchers(MetaClass owner, java.util.List<Dispatcher> dispatchers)
Facet
Dispatcher
s that look at one token and binds that
to the views associated with the 'it' object.buildViewDispatchers
in class Facet
public java.util.Collection<java.lang.Class<JellyClassTearOff>> getClassTearOffTypes()
getClassTearOffTypes
in interface JellyCompatibleFacet
public java.util.Collection<java.lang.String> getScriptExtensions()
JellyCompatibleFacet
getScriptExtensions
in interface JellyCompatibleFacet
public javax.servlet.RequestDispatcher createRequestDispatcher(RequestImpl request, Klass<?> type, java.lang.Object it, java.lang.String viewName) throws java.io.IOException
Facet
RequestDispatcher
that handles the given view, or
return null if no such view was found.createRequestDispatcher
in class Facet
type
- If "it" is non-null, it.getClass()
. Otherwise the class
from which the view is searched.java.io.IOException
public boolean handleIndexRequest(RequestImpl req, ResponseImpl rsp, java.lang.Object node, MetaClass nodeMetaClass) throws java.io.IOException, javax.servlet.ServletException
Facet
handleIndexRequest
in class Facet
java.io.IOException
javax.servlet.ServletException
public static void setExpressionFactory(javax.servlet.ServletContextEvent event, org.apache.commons.jelly.expression.ExpressionFactory factory)
ExpressionFactory
to be used to parse views.
This method should be invoked from your implementation of
ServletContextListener.contextInitialized(ServletContextEvent)
.
Once views are parsed, they won't be re-parsed just because you called this method to override the expression factory.
The primary use case of this feature is to customize the behavior of JEXL evaluation.
Copyright © 2013. All Rights Reserved.