我使用两种不同版本的ColdFusion,ColdFusion 9并且两者ColdFusion 10都有所不同XSLT Processors.
ColdFusion 9在使用Apache Xalan时ColdFusion 10正在使用Saxon.
那么,是否有可能改变XSLT Processor?
要么
我们可以使用javax.xml.transform.TransformerFactory类切换到不同的处理器吗?
我正在使用MongoDB 3.2.3和mongo-java-driver-3.2.2.jar库.
为了连接到服务器然后连接到特定数据库,我执行了以下操作.然后我创建一个名为的集合col1:
<cfset Mongo = CreateObject("java","com.mongodb.MongoClient")>
<cfset Mongo.init("192.168.0.30")>
<cfset db = Mongo.getDatabase('testaj')>
<cfset db.createCollection("col1") >
Run Code Online (Sandbox Code Playgroud)
我从互联网上获得了以下代码,以便将文档插入到集合中:
<cffunction name="m" returntype="any">
<cfargument name="value" type="any">
<cfif IsJSON(arguments.value)>
<cfset local.retrun = CreateObject("java","com.mongodb.util.JSON").parse(arguments.value)>
<cfelse>
<cfset local.retrun = CreateObject("java","com.mongodb.util.JSON").parse( SerializeJSON(arguments.value) )>
</cfif>
<cfreturn local.retrun>
</cffunction>
<cfset doc = {
"Name" = "Marc",
"Spouse"= "Heather",
"Fruit" = "Mango",
"Kids" = [
{"Name"="Alexis", "Age"=7, "Hair"="blonde", "Description"="crazy" },
{"Name"="Sidney", "Age"=2, "Hair"="dirty blonde", "Description"="ornery" }
],
"Bike" = "Felt",
"LoveSQL" = true,
"TS" = now(),
"Counter" = …Run Code Online (Sandbox Code Playgroud) 什么是正确的方法?我认为两者都有效,但我想知道是否有好处.
<CFFUNCTION name="setSomething" access="public" output="no" returntype="void">
<CFSET ... />
</CFFUNCTION>
Run Code Online (Sandbox Code Playgroud)
要么
<CFFUNCTION name="setSomething" access="public" output="no" returntype="void">
<CFSET ... />
<CFRETURN />
</CFFUNCTION>
Run Code Online (Sandbox Code Playgroud) 我正在使用ColdFusion 8.我想NoClassDefFoundError在ColdFusion中捕获异常但是我不能...它仍然失败并将错误记录在exception.log文件中.这是我试过的.
<cftry>
<cfset myJavaObject.myMethod()>
<cfcatch type="any">
<cfdump var="#cfcatch #">
</cfcatch>
<cfcatch type="java.lang.Throwable">
Horrible exception.
<cfdump var="#cfcatch #">
</cfcatch>
</cftry>
Run Code Online (Sandbox Code Playgroud)
但这不起作用.你能告诉我怎么做吗?我需要在特定的地方捕获此错误,而不是OnError我的Application.cfc 的功能.
我有一个简单的问题,但我很惊讶.
此代码有效:
int itemID = 1;
string dirPath = @"C:\" + itemID + @"\abc";
Run Code Online (Sandbox Code Playgroud)
itemID.ToString()在这种情况下我为什么不这么做?
我已经设置了我的ColdFusion应用程序,使用下面的代码设置HTTPOnly cookie(来自http://www.petefreitag.com/item/764.cfm):
<cfcomponent output="false">
<cfscript>
THIS.Name = "MyCFApp";
THIS.SessionManagement = true;
THIS.SetClientCookies = false;
THIS.SessionTimeout = CreateTimeSpan(0, 3, 0, 0);
THIS.ApplicationTimeout = CreateTimeSpan(0, 8, 0, 0);
</cfscript>
<cffunction name="onSessionStart" returntype="Void" output="false">
<cfheader
name="Set-Cookie"
value="CFID=#SESSION.CFID#;path=/;HTTPOnly;#APPLICATION.SECURE_COOKIES#;" />
<cfheader
name="Set-Cookie"
value="CFTOKEN=#SESSION.CFTOKEN#;path=/;HTTPOnly;#APPLICATION.SECURE_COOKIES#;" />
<cfreturn />
</cffunction>
</cfcomponent>
Run Code Online (Sandbox Code Playgroud)
(仅供参考,APPLICATION.SECURE_COOKIES允许我为安全cookie设置特定于应用程序的值 - 生产是SSL,因此我可以做到安全,但我的本地开发环境不是SSL,所以这是空的.)
当我在Google Chrome中清除Cookie /会话并重新加载页面时,我可以Set-Cookie在调试器中看到响应标头:

当我在调试器中检查cookie时,它们被标记为HTTPOnly:

当我在IE9中执行相同操作时,我可以Set-Cookie在调试器中看到标题:

但是,对于相同的请求,cookie在调试器中可见:

当我在IE9中重新加载时,cookie是可见的,但不会标记为HTTPOnly:

IE9在这里发生了什么?如何解决此问题以正确设置HTTPOnly Cookies?
cookies coldfusion internet-explorer httponly session-cookies
当ColdFusion首次使用jRun引擎发布时,许多用户当时的一个问题是我们如何针对Windows AD环境进行身份验证?当时(如果我没记错的话),Macromedia可以免费使用cfc,它使用一个或多个与jRun一起提供的Java类文件创建一个Java对象(组件的相关功能代码出现在末尾)此消息没有归属)并执行了"身份验证过程".我认为我们的小员工不是多年来唯一使用该代码的开发人员.
我们一直在将该代码用于CF服务器的版本6-9.代码运行良好,但是使用CF 10并取消jRun作为底层Java服务器,代码不再起作用,因为类文件不包含在Tomcat服务器中.还有其他人处于或处于类似情况吗?如果是这样,您是如何影响到CF 10的过渡并继续对Microsoft Active Directory进行身份验证的?
在我们特定的业务环境中,LDAP未配置为进行身份验证,因此针对LDAP进行身份验证不是我们的选项,并且LDAP控制不在我们的小部门的范围内(由我们的影响范围之外的中央IT机构处理).至于我们的本地服务器,我们运行Windows Server 2008 R2,IIS 7.5,JRE 1.7 64位和ColdFusion 10 SE 64位.如果有人有任何想法分享,我将不胜感激.
代码链接如下
<!--- Authenticates the user and outputs true on success and false on failure. --->
<CFFUNCTION NAME="authenticateUser" ACCESS="REMOTE" OUTPUT="yes" STATIC="yes" HINT="Authenticates the user.">
<CFARGUMENT NAME="userid" TYPE="string" REQUIRED="true" />
<CFARGUMENT NAME="passwd" TYPE="string" REQUIRED="true" />
<CFARGUMENT NAME="domain" TYPE="string" REQUIRED="true" />
<CFTRY>
<CFSCRIPT>
ntauth = createObject("java", "jrun.security.NTAuth");
ntauth.init(arguments.domain);
// authenticateUser throws an exception if it fails,
// so we don't have anything specific here
ntauth.authenticateUser(arguments.userid, arguments.passwd); …Run Code Online (Sandbox Code Playgroud) 任何人在ColdFusion 11中遇到cfflush标签问题?我们有一个例程,它在处理循环时更新实时记录计数.在ColdFusion 10中,这很好用.在ColdFusion 11中,它会一直等到循环结束才能更新屏幕.不是我们所期望的.
编辑按要求添加代码...
<script language="javascript">
addOutputLine('<br /><span id="insertCount">Records Inserted: 0</span>')
</script>
<cfset insertCount = 0>
<cfset updateCountAfter = 1>
<cfif qry.recordcount gt 5000>
<cfset updateCountAfter = 10>
</cfif>
<cfoutput query="qry" startrow="#DATASTART#">
<!---do some stuff here that is not important to this issue--->
<cfset insertCount = insertCount + 1>
<cfif updateCountAfter gt 1>
<cfif insertCount mod updateCountAfter eq 0>
<script language="javascript">document.getElementById('insertCount').innerHTML = 'Records Inserted: #insertCount#';</script>
</cfif>
<cfelse>
<script language="javascript">document.getElementById('insertCount').innerHTML = 'Records Inserted: #insertCount#';</script>
</cfif>
<cfflush>
</cfoutput>
Run Code Online (Sandbox Code Playgroud) 在ColdFusion 11中,Adobe增加了NTLM支持.但是我不明白我是如何让这个工作的.
特别是,文档似乎是错误的:它指出:
对于NTLM,要使用,redirect属性必须设置为false
但是,这样做时,ColdFusion会抛出以下异常:
当身份验证类型为NTLM时,不得将重定向设置为false.
有没有人使用了经验NTLM的CFHTTP?
我正在使用的代码:
<cfhttp url="#variables.webserviceURL#"
method="post"
result="httpResponse"
charset="utf-8"
timeout="3000"
authType="NTLM"
domain="myDomain"
username="myUser"
password="myPassword">
<cfhttpparam type="header" name="accept-encoding" value="no-compression" />
<cfhttpparam type="xml" value="#trim(soapRequest)#"/>
</cfhttp>
Run Code Online (Sandbox Code Playgroud) 我打算用hadoop和hive来解决以下问题:
我有一个数据流,比如表示给定时间戳的测量温度的形式(时间戳,温度).我需要每天计算一些聚合(例如最大值).聚合需要每天计算一次(例如在午夜).
我想到以某种方式加载数据到hive,按日期划分它.但是,有一个问题 - 流中的数据不需要按时间戳排序,我收到延迟记录:记录甚至可能比它应该晚几天到达.在这种情况下,在生成常用聚合时,我还需要计算包含该时间戳的日期的聚合.
直觉上,我想将后期记录添加到配置单元表中的相应分区.是否可以在不重新加载整个分区的情况下执行此操作?(重新加载分区是一项代价高昂的操作吗?)