我根本没有cURL的经验,但从我可以收集到的,它相当于cfhttp.
我想使用Instagram API并验证用户身份.他们的例子使用cURL.
curl \-F 'client_id=CLIENT-ID' \
-F 'client_secret=CLIENT-SECRET' \
-F 'grant_type=authorization_code' \
-F 'redirect_uri=YOUR-REDIRECT-URI' \
-F 'code=CODE' \https://api.instagram.com/oauth/access_token
Run Code Online (Sandbox Code Playgroud)
我认为CF版本会是正确的吗?
<cfhttp url="https://api.instagram.com/oauth/access_token" method="post" resolveurl="true">
<cfhttpparam type="formField" name="client_id" value="CLIENT-ID" />
<cfhttpparam type="formField" name="client_secret" value="CLIENT-SECRET" />
<cfhttpparam type="formField" name="grant_type" value="authorization_code" />
<cfhttpparam type="formField" name="redirect_uri" value="YOUR-REDIRECT-URI" />
<cfhttpparam type="formField" name="code" value="code" />
</cfhttp>
Run Code Online (Sandbox Code Playgroud)
我无法尝试这一点,因为直到很久以后我才会在我的开发机器上,所以我现在只是在寻找可能性并制作伪代码(未经过测试!).
任何具有Instagram API和ColdFusion经验的人都可以获得一些见解,我们将不胜感激.
我正在使用Railo.
我在integer [] Native Array中有一些数据,我想对它执行ArrayAppend/ArrayDeleteValue操作.我注意到这在Railo 3.3中无声地失败,因为本机数组类型是固定长度的(您可以更改值但不能添加/删除).
问题是我可以将原生数组转换为常规的coldfusion/railo数组对象而不进行迭代吗?是否有某种内置功能/方法,或者我必须自己编写?
我正在使用 Railo 3.0 作为 Web 应用程序(设置与本优秀指南完全相同)。我有一个 CFM 页面,它使用 cfcontent 标签提供一些旧的 HTML 文件。该内容采用各种字符集(全部定义为 HTML 中的元标记)。问题是我的所有 CFM 页面都是通过 HTTP 响应标头中设置的 UTF-8 发送的,这会覆盖 HTML 中定义的任何内容。因此,页面在浏览器中显示不正确。
如何停止在 CFM 页面的 HTTP 标头中发送字符集?
注意:我已经从默认的 Apache 配置中删除了 AddDefaultCharset 条目,这意味着现在提供的静态 HTML 页面在标头中没有任何字符集,但这对 CFM 页面没有帮助 - AddDefaultCharset 很糟糕,很糟糕,很糟糕
我正在尝试在Railo上启动测试MG应用程序,并且遇到了障碍.当我访问MG应用程序时,我得到:
Railo 3.1.0.012 Error (Java.lang.classformaterror)
Message Invalid index 16 in LocalVariableTable in class file
application_cfc$cf
Java Stacktrace
Invalid index 16 in LocalVariableTable in class file application_cfc
$cf
at java.lang.ClassLoader.defineClass1(Native Method):-2
at java.lang.ClassLoader.defineClass(ClassLoader.java:621):621
at java.lang.ClassLoader.defineClass(ClassLoader.java:401):401
at railo.commons.lang.PhysicalClassLoader.loadClass
(PhysicalClassLoader.java:116):116
at railo.runtime.PageSourceImpl.compile(PageSourceImpl.java:225):225
at railo.runtime.PageSourceImpl.loadPhysical(PageSourceImpl.java:167):
167
at railo.runtime.PageSourceImpl.loadPage(PageSourceImpl.java:102):102
Run Code Online (Sandbox Code Playgroud)
我做了一些测试,发现当Application.cfc中发生以下情况时:
<cfloop from="1" to="#arrayLen(mgInstances)#" index="i">
<cfset mgInstances[i].executeEvent(arguments.eventName, values) />
</cfloop>
Run Code Online (Sandbox Code Playgroud)
我收到了错误.如果我删除这部分,我开始得到:
Message Application context not loaded!
Error Code
org.coldspringframework.webApplicationContextProxy.cantLoadApplicationContext
Run Code Online (Sandbox Code Playgroud)
所以,我猜测在Application.cfc中,行:
<cfset var mgInstances = createObject
("component","ModelGlue.Util.ModelGlueFrameworkLocator").findInScope
(appScope) />
Run Code Online (Sandbox Code Playgroud)
失败了.
还有其他人有这个问题吗?有解决方案吗 谢谢!!!
是否最好在linux或Windows服务器上实现railo?它设计的哪个操作系统最顺畅?我说的是从安装到开发再到现实世界中的部署.
我刚刚开始在一个新项目中使用 Hibernate,对于我的第一个实体,我遇到了一个错误,我似乎无法弄清楚。
我现在的架构只有两个表:大洲和国家,其中国家/地区有一个 ContinentalID 外键。
当我尝试运行调用大陆实体的代码时,我得到一个空白页面。所有处理都会停止,但不会显示任何错误。当我通过 MXUnit 运行代码时,我实际上收到了一个错误。错误信息很简单Could Not Load an Entity: [continent#1]。异常的原因是org.hibernate.exception.SQLGrammarException。这就是我得到的全部。
我的实际实体代码是:
大陆.cfc
component tablename='continents' persistent=true output=false{
property name='id' type='numeric' fieldtype='id' datatype='integer';
property name="name" type='string' length='45';
property name='bonus' type='numeric';
property name='countries' type='array' fieldtype='one-to-many' cfc='Country' singularname='country' inverse='true' fkcolumn='continentid' cascade='all-delete-orphan';
public Country function init(string name='', numeric bonus=0){
setName(Arguments.name);
return this;
}
}
Run Code Online (Sandbox Code Playgroud)
国家.cfc
component tablename='countries' persistent=true output=false{
property name='id' type='numeric' fieldtype='id' datatype='integer' generator="identity";
property name="name" type='string' length='45';
property name='continent' fieldtype='many-to-one' fkcolumn='continentid' cfc='Continent' missingRowIgnored=true;
public Country function …Run Code Online (Sandbox Code Playgroud) 我正在尝试将文件上传添加到我的 CFWheels + Railo 应用程序中。但在尝试使用时我不断收到此错误消息<cffile action="upload">:
Form field [asset[file]] doesn't exist or has no content
Run Code Online (Sandbox Code Playgroud)
我该如何解决?
我个人想不到一个,但我真诚地希望听到任何认为Adobe ColdFusion仍然物有所值的人.
我正在尝试使用CFCSV 自定义标签解析 CSV 。这是我的 CFML 代码:
<cfset data = fileRead( "inputtest.csv", "utf-8" ) />
<cfcsv action="parse" data="#data#" variable="csv" hascolumnnames="true" delimiter="," />
<cfloop query="csv">
<cfoutput>#csv.name#</cfoutput>
</cfloop>
Run Code Online (Sandbox Code Playgroud)
..和我的测试 CSV:
"Email","Name","Address1","Address2","City","State","ZIP","Country","Phone"
"somedude@foobar.com","Some Dude","3129 golden bridge ave",,"somecity","somestate","somezip","usa","1234567890"
Run Code Online (Sandbox Code Playgroud)
我得到的错误是:
在查询中找不到列 [NAME],列为 [电子邮件、名称、地址 1、地址 2、城市、州、邮政编码、国家/地区、电话]
如果我更改循环以输出名称以外的任何内容,它就会起作用。但我无法得到名字。即使将列名从 更改为Name也会TheName导致相同的错误:
在查询中找不到列 [THENAME],列为 [电子邮件、名称、地址 1、地址 2、城市、州、邮政编码、国家/地区、电话]
但同样,我输出电子邮件地址或任何其他列都没有问题。更改 CSV 中列的位置和/或从cfloop queryplus更改cfoutput为 justcfoutput query没有任何效果。
如果我cfdump查询,该列就在那里。