<map:when test="servlet:servlet:/path/to/file> always returns true ------------------------------------------------------------------
Key: COCOON-2096 URL: https://issues.apache.org/jira/browse/COCOON-2096 Project: Cocoon Issue Type: Bug Components: - Components: Sitemap Affects Versions: 2.2-dev (Current SVN) Reporter: Alexander Weber sitemap from myBlock1-the filename.txt exist at resource/external/filename.txt - the myBlock2 is a bean id - myBlock3 id does not exist or the file does not exists in myBlock3: <map:match pattern="filename.txt"> <map:select type="resource-exists"> <map:when test="servlet:myBlock3:resource/external/filename.txt"> <map:read src="servlet:myBlock3:resource/external/filename.txt"/> </map:when> <map:otherwise> <map:read src="servlet:myBlock2:/resource/external/filename.txt"/> </map:otherwise> </map:select> </map:match> Since myBlock3 does not exist, i am expecting that "test=" returns false and map:otherwise is used. But unfortunately it _always_ returns true. It is acting as if the "servlet:myBlock3:" part is completely ignored. Grzegorz reported back on the User-maillist: [quote] Alex, I've just checked sources of servlet: protocl (source) that it looks[1] like this: /** * Returns true always. * * @see org.apache.excalibur.source.Source#exists() */ public boolean exists() { return true; } [/quote] reported on maillist: http://www.nabble.com/-cocoon-2.2.x--site-can-check-for-file-exists--t4040666.html Alexander Weber -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.