|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.velocity.app.event.implement.IncludeNotFound
public class IncludeNotFound
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
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.apache.velocity.app.event.IncludeEventHandler |
---|
IncludeEventHandler.IncludeEventExecutor |
Constructor Summary | |
---|---|
IncludeNotFound()
|
Method Summary | |
---|---|
String |
includeEvent(String includeResourcePath,
String currentResourcePath,
String directiveName)
Chseck to see if included file exists, and display "not found" page if it doesn't. |
void |
setContext(Context context)
Initialize the EventHandler. |
void |
setRuntimeServices(RuntimeServices rs)
Called automatically when event cartridge is initialized. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IncludeNotFound()
Method Detail |
---|
public String includeEvent(String includeResourcePath, String currentResourcePath, String directiveName)
includeEvent
in interface IncludeEventHandler
includeResourcePath
- currentResourcePath
- directiveName
-
public void setRuntimeServices(RuntimeServices rs)
RuntimeServicesAware
setRuntimeServices
in interface RuntimeServicesAware
rs
- RuntimeServices object assigned during initializationRuntimeServicesAware.setRuntimeServices(org.apache.velocity.runtime.RuntimeServices)
public void setContext(Context context)
ContextAware
setContext
in interface ContextAware
ContextAware.setContext(org.apache.velocity.context.Context)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |