1

I was charged with making some modification to an old application, and I created a new page which was being passed a URL parameter page_name, which is a you guessed it a name of a page with .cfm appended. So, in my haste, I continued using it, and was building out my CFC and using the page_name as the identifier for a record. Then I realized that there is a possibility of that name being duplicated in the table, and changed that url parameter to use the page_id, which is unique. I modified my CFC to use the new key, and nothing worked. So I started going through my code and figured I made a typo, started commenting things out, and finally dumped out my CFC object and voila, none of the edits I made were actually being used. This was fairly obvious, since page_name was a string, and page_id was numeric.

So I started googling,The first thing I saw as adjust things in the CFAdmin. I don't have access to it, and restarting the server isn't an option since I'm using an RDS to live code. The next thing I tried was to add applicationStop(), onApplicationStart(), to my Application.cfc. Well the problem is that the Application.cfc, is actually an Application.cfm. So after fiddling with the <cfapplication ... > tag, and nothing being updated, I'm here asking for help.

So is there a quick fix for this? Should I go ahead and create an application.cfc? I hope I explained myself, and sorry for all the text.

4

2 回答 2

1

确认您的 cfc 绑定到会话或应用程序范围。

如果是,那么您可以在 application.cfm 中重命名应用程序,它将重置对象。

如果您的 cfc 未绑定到会话或应用程序范围,则说明存在缓存问题。您需要转到 CF 管理员 -> 服务器设置 -> 缓存选项卡并取消选中component cache,可能还有其他一些选项。

如需进一步的建议,请参阅 ColdFusion Components Inheriting Functions Of Others

于 2013-11-19T20:37:20.687 回答
1

听起来你已经被画到角落里了。最后一个选项如果您可以访问它自己的服务器并且可以进入 C:\ 或安装了 ColdFusion 的任何驱动器,您可以手动删除服务器正在使用的具有旧代码的生成的 Java 类文件。当 ColdFusion 发现没有 Class 文件时,它会重新编译新更改的文件,哇,黑贝蒂 go bam-a-lam 您的更改将投入生产。

有关更多信息,您可以阅读以下帖子:http: //kalyan-coldfusion.blogspot.com/2010/08/how-coldfusion-works-and-its-key.html

干杯

于 2013-11-19T21:44:58.983 回答