找不到自定义标签的 CFML 模板
我不是 ColdFusion 编码员。帮一位朋友帮忙,将他的 CF 网站从 Windows 服务器移植到 GoDaddy 上的 Unix。
网站显示错误:
找不到自定义标记 jstk 的 CFML 模板。冷聚变 尝试在已安装的自定义标签的树中查找,但没有 查找具有此名称的自定义标签。
我发现该网站在文档根目录 /CustomTags 中包含 jstk.cfm 文件和 cf_jstk 中的一组文件,
我的谷歌搜索找到了以下内容:
您必须将自定义标记页面存储在以下任一位置: 与调用页面同目录; cfusion\CustomTags 目录; cfusion\CustomTags 目录的子目录; 您在 ColdFusion Administrator 中指定的目录
所以我有:
- 尝试创建将 /CustomTags 放置在 /cfusion/CustomTags
- 尝试将 /cfusion/CustomTags 复制到上面的文档根目录
- 尝试将 jstk.cfm 和子文件夹复制到与调用 file(index.cfm )
更新:根据 GoDaddy 支持,我还尝试添加以下内容但没有效果:
任何人都可以给我一些关于此问题的提示吗?就告诉我的人去找一个 CF 编码员吗?
谢谢!
I am not a ColdFusion coder. Doing a favor for a friend who ported his CF site from a Windows server to Unix on GoDaddy.
Site is displaying error:
Cannot find CFML template for custom tag jstk. ColdFusion
attempted looking in the tree of installed custom tags but did not
find a custom tag with this name.
The site as I found it has at document root /CustomTags with the jstk.cfm file and a set of files in cf_jstk
My Googling located this:
You must store custom tag pages in any one of the following:
The same directory as the calling page;
The cfusion\CustomTags directory;
A subdirectory of the cfusion\CustomTags directory;
A directory that you specify in the ColdFusion Administrator
So I have:
- Tried creating placing /CustomTags in /cfusion/CustomTags
- Tried copying /cfusion/CustomTags to above document root
- Tried copying jstk.cfm and subfolders into same directory as calling file(index.cfm)
Update: Per GoDaddy support I have also tried adding the following to no effect: <cfmodule template="CustomTags/jstk.cfm">
Can any one give me some tips on this or should I just tell my guy to look for a CF coder?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我不知道 GoDaddy 是如何设置的,因此作为快速测试,请执行以下操作:
在 webroot 中创建文件
test.cfm
,内容为:创建文件
testtag.cfm
> 在 webroot 中包含内容:然后在浏览器中访问 test.cfm 页面。
您应该获得两个调试转储,然后是“测试”;这将确认自定义标签总体上正在工作。
如果有效,请将
testtag.cfm
移至 CustomTags 目录,然后查看是否出现相同的行为或错误。如果这会产生错误,对于 CF8 及更高版本,您可以在
Application.cfc
内添加
文件(假设有 App cfc 而不是Application.cfm
),以确保检查目录中的标签。可以将 Application.cfm 转换为 Application.cfc - 这有多容易取决于代码的复杂程度 - 可能是您可以弄清楚的东西,或者可能需要经验丰富的 CF 开发人员,这取决于。
根据此结果,我们可以尝试调试
jstk
标记不起作用的原因(除非上述方法之一解决了该问题)。I don't know how GoDaddy is setup, so as a quick test, please do the following:
Create file
test.cfm
in the webroot with contents:Create file
testtag.cfm
in the webroot with contents:Then in a browser visit the test.cfm page.
You should get two debug dumps, followed by the 'test'; this will confirm that custom tags in general are working.
If that works move the
testtag.cfm
to the CustomTags directory, and see if you get the same behaviour or an error.If this produces an error, for CF8 and above, you can add
<cfset This.CustomTagPaths = "/CustomTags" />
inside theApplication.cfc
file (assuming there is a App cfc and not anApplication.cfm
) to ensure that directory is checked for tags.It is possible to convert Application.cfm to Application.cfc - how easy this is depends on how complex the code is in there - might be something you could figure out, or might need an experienced CF dev, it depends.
Depending on the outcome of this, we can attempt to debug why the
jstk
tag isn't working (unless one of the above solves it).在担心复杂的事情之前先检查简单的事情:
请记住,*nix 系统上的文件名区分大小写,但 Windows 上则不然。
例如,Windows 服务器将获取“application.cfm”,但 Linux 服务器不会。它需要“Application.cfm”。
检查以确保所有文件名/路径的大小写正确。
In an effort to check the simple things before worrying about complex things:
Remember that filenames on *nix systems are case sensitive, but on windows are not.
For example, a windows server will pick up "application.cfm" but a linux server won't. It requires "Application.cfm".
Check to make sure all filenames/paths are the correct case.
通常,CFML 首先检查当前目录中的每个自定义标签,如果没有找到,第二个在 CFMX8/customtags/ 中。
Normally, CFML check every custom tags in current directory first, if not found, second is in CFMX8/customtags/.