IncludeNotFound event handler not including the "notfound" page
---------------------------------------------------------------
Key: VELOCITY-551
URL: https://issues.apache.org/jira/browse/VELOCITY-551
Project: Velocity
Issue Type: Bug
Components: Engine
Affects Versions: 1.5
Environment: Linux (Fedora Core 5) / OSX 10.4.9
Java 6
Tomcat 6.0.10
Struts2
Reporter: Michiel Toneman
The IncludeNotFound event handler claims in the log "Can't find include not
found
page: " even though the "notfound" page exists.
I've tracked this in the source:
------------------------------------------------
boolean exists = (rs.getLoaderNameForResource(includeResourcePath) != null);
if (!exists)
{
if (rs.getLoaderNameForResource(notfound) == null)
{
return notfound;
}
else
{
/**
* can't find not found, so display nothing
*/
rs.getLog().error("Can't find include not found page:
" + notfound);
return null;
}
}
else
return includeResourcePath;
---------------------------------------------------
I think the condition:
if (rs.getLoaderNameForResource(notfound) == null)
should read:
if (rs.getLoaderNameForResource(notfound) != null)
Changing this fixed the problem for me.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]