Package org.apache.wicket.velocity
Class VelocityJavaScriptContributor
java.lang.Object
org.apache.wicket.behavior.Behavior
org.apache.wicket.velocity.VelocityContributor
org.apache.wicket.velocity.VelocityJavaScriptContributor
- All Implemented Interfaces:
Serializable
,IComponentAwareEventSink
,IComponentAwareHeaderContributor
,IClusterable
A derivation of VelocityContributor that uses
IHeaderResponse.render(org.apache.wicket.markup.head.HeaderItem)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionVelocityJavaScriptContributor
(Class<?> clazz, String templatePath, IModel<? extends Map<String, Object>> model, String id) Use this constructor if you have configured Velocity to use a ClasspathResourceLoader.VelocityJavaScriptContributor
(String templatePath, IModel<? extends Map<String, Object>> model, String id) Use this constructor when Velocity is configured with theFileResourceLoader
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
renderHead
(Component component, IHeaderResponse response) Render to the web response whatever the component wants to contribute to the head section.Methods inherited from class org.apache.wicket.velocity.VelocityContributor
detach, escapeHtml, evaluate, getEncoding, setEncoding
Methods inherited from class org.apache.wicket.behavior.Behavior
afterRender, beforeRender, bind, canCallListener, getStatelessHint, isEnabled, isTemporary, onAttribute, onComponentTag, onConfigure, onEvent, onException, onRemove, onTag, unbind
-
Constructor Details
-
VelocityJavaScriptContributor
public VelocityJavaScriptContributor(Class<?> clazz, String templatePath, IModel<? extends Map<String, Object>> model, String id) Use this constructor if you have configured Velocity to use a ClasspathResourceLoader. The templatePath will then be relative to the package for clazz- Parameters:
clazz
-templatePath
-model
-id
-
-
VelocityJavaScriptContributor
public VelocityJavaScriptContributor(String templatePath, IModel<? extends Map<String, Object>> model, String id) Use this constructor when Velocity is configured with theFileResourceLoader
. templatePath with then be relative to the loader path configured in velocity.properties- Parameters:
templatePath
-model
-id
-
-
-
Method Details
-
renderHead
Render to the web response whatever the component wants to contribute to the head section.- Specified by:
renderHead
in interfaceIComponentAwareHeaderContributor
- Overrides:
renderHead
in classVelocityContributor
- Parameters:
component
- component which is contributing to the response. This parameter is here to give the component as the context for component-awares implementing this interfaceresponse
- Response object
-