ColdFusion code example in Ehcache documentation contains errors. Here's a suggestion for correction.

3 views
Skip to first unread message

bakiaba...@gmail.com

unread,
Nov 5, 2025, 6:25:07 AMNov 5
to ehcache-users
This concerns the ColdFusion code example on the page https://www.ehcache.org/documentation/2.8/integrations/coldfusion.html

It contains two errors, which I shall now correct:

(1) Initially, the object named "cache" does not exist, resulting in an error on the line 
<cfset myBookElement=#cache.get("myBook")#>
To correct this, replace that line with
<cfif !isNull(cache)>
<cfset myBookElement=cache.get("myBook")>
</cfif>
(2) The following line is incorrect CFML syntax:
<cfset cache.put(myBookElement)>
Correct is:
 <cfset cacheput("MyBookCache",myBookElement)>
I hope the people at Ehcache/Terracotta will correct the documentation accordingly.

Regards,
BKBK
Reply all
Reply to author
Forward
0 new messages