Class IncludeNotFound
java.lang.Object
org.apache.velocity.app.event.implement.IncludeNotFound
- All Implemented Interfaces:
- EventHandler,- IncludeEventHandler,- ContextAware,- RuntimeServicesAware
public class IncludeNotFound
extends Object
implements IncludeEventHandler, RuntimeServicesAware, ContextAware
Simple event handler that checks to see if an included page is available.
 If not, it includes a designated replacement page instead.
 
By default, the name of the replacement page is "notfound.vm", however this
 page name can be changed by setting the Velocity property
 eventhandler.include.notfound, for example:
 eventhandler.include.notfound = error.vm
 The name of the missing resource is put into the Velocity context, under the
 key "missingResource", so that the "notfound" template can report the missing
 resource with a Velocity reference, like:
 $missingResource
 
- Since:
- 1.5
- Version:
- $Id$
- Author:
- Will Glass-Husain
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionincludeEvent(Context context, String includeResourcePath, String currentResourcePath, String directiveName) Check to see if included file exists, and display "not found" page if it doesn't.voidsetContext(Context context) Initialize the EventHandler.voidCalled automatically when event cartridge is initialized.
- 
Field Details- 
logprotected org.slf4j.Logger log
 
- 
- 
Constructor Details- 
IncludeNotFoundpublic IncludeNotFound()
 
- 
- 
Method Details- 
includeEventpublic String includeEvent(Context context, String includeResourcePath, String currentResourcePath, String directiveName) Check to see if included file exists, and display "not found" page if it doesn't. If "not found" page does not exist, log an error and return null.- Specified by:
- includeEventin interface- IncludeEventHandler
- Parameters:
- context- current context
- includeResourcePath-
- currentResourcePath-
- directiveName-
- Returns:
- message.
 
- 
setRuntimeServicesDescription copied from interface:RuntimeServicesAwareCalled automatically when event cartridge is initialized.- Specified by:
- setRuntimeServicesin interface- RuntimeServicesAware
- Parameters:
- rs- RuntimeServices object assigned during initialization
- See Also:
 
- 
setContextDescription copied from interface:ContextAwareInitialize the EventHandler.- Specified by:
- setContextin interface- ContextAware
- Parameters:
- context-
- See Also:
 
 
-