直接访问 application.cfc 会产生未捕获的 ColdFusion 错误

发布于 2024-12-20 17:54:55 字数 412 浏览 4 评论 0原文

我正在使用 application.cfc 开发一个新的 ColdFusion 9 应用程序,只是为了好玩,我想看看如果直接导航到 application.cfc 会发生什么,如下所示:

http://www.mysite.com/application.cfc

我有点惊讶地看到一个未捕获的错误,其实质是:

“应用程序请求无效。 cfm, Application.cfc 或 OnRequestEnd.cfm 文件”

经过一番研究后,似乎没有真正的方法可以在应用程序本身内处理此问题 - 或者至少到目前为止我还没有找到方法。

对于这个问题有什么好的解决方案吗?

提前致谢!

I'm developing a new ColdFusion 9 application using application.cfc, and just for kicks I wanted to see what happens if I navigate directly to application.cfc, like this:

http://www.mysite.com/application.cfc

I was somewhat surprised to see an untrapped error, the meat of which is:

"Invalid request of Application.cfm, Application.cfc, or OnRequestEnd.cfm file"

After some digging around, it appears that there's no real way to handle this within the application itself--or at least no way that I've found thus far.

Are there any decent solutions for this problem out there?

Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

绅士风度i 2024-12-27 17:54:55

答案是通过 ColdFusion Administrator 使用全局错误处理程序:

在此处输入图像描述

在这里,您将输入值您构建的 cf 模板的一部分,并捕获由于直接访问 Application.cfc 而出现的必要错误。

The answer is to use the global error handler via ColdFusion Administrator:

enter image description here

Here, you'll enter in the value of a cf template that you build, and trap the necessary errors that come in as a result of direct access to Application.cfc.

玩世 2024-12-27 17:54:55

好吧,如果您不想使用站点范围的错误处理程序,您可以简单地使 Application.cfc 不可通过 Web 浏览,然后让您的 404 处理程序处理它。

Well, if you don't want to use the site-wide error handler, you could simply make the Application.cfc not web browseable, then let your 404-handler deal with it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文