我在我的笔记本电脑上使用自己的ColdFusion 8服务器开发了coldFusion应用程序,该服务器在Windows Vista上运行.我有一个相当讨厌的问题.
问题是每当我对我的CFC进行任何更改时,看起来除非我重新启动我的ColdFusion应用程序服务器,否则对我的CFC的更改将不会生效.通常,我必须重新启动整个计算机,因为Windows无法重新启动ColdFusion Application Server服务.有没有更好的方法来重置ColdFusion服务器的cfc缓存?
这种情况开始耗费大量时间,因为我必须经常在我做出改变后重新开始.任何见解将不胜感激!
谢谢!
在ColdFusion中,如何确定查询字符串中是否存在变量而不会尝试检查错误?
我有一个像这样的ColdFusion CFC函数:
<cffunction access="remote" name="getResults"
returntype="struct"
returnformat="JSON"
output="no">
<cfargument name="q" required="true" type="array" />
...
</cffunction>
Run Code Online (Sandbox Code Playgroud)
如何从jQuery调用此函数?jQuery的数组编码都不会让ColdFusion将值视为数组.
如果传递"q = a&q = b"(与jQuery.ajaxSettings.traditional = true一样),函数将获得字符串"a,b",而不是数组.虽然在逗号上拆分似乎是可能的,但如果其中一个"q"值包含逗号,它将无法工作.另外,理想情况下,服务器端的功能不应该知道如何通过线路序列化数据的问题,并且应该继续接收数组.
如果传递"q [] = a&q [] = b"(jQuery默认值),它将不会映射到"q"参数.如果您尝试将"q"参数的名称更改为"q []",则由于参数名称无效,CFC将出错.
我有一个接收一串标签的函数.为了单独保存标记,该函数将字符串转换为数组:
this.tags = listToArray(this.tags, ", ");
如果存在重复值,如何删除重复值?
我很喜欢cfsavecontent,因为我们可以将长文本转换为变量(事件我可以在其中转储).但最近更多人开始使用CFSCRIPT,无法弄清楚如何在cfscript标签中使用它.
有没有办法在cfscript中编写cfsavecontent.据我所知,没有这样的功能或类可用,并且确定它也很难实现.
感谢任何反馈.
谢谢Pritesh
我正在使用ColdFusion 9.1.
我需要在一些查询中使用两个不同的数据源.我知道它可以完成,因为我看到其他代码使用两个不同的数据源,它工作正常.
我已经尝试了很多组合,但无法获得任何工作,但我知道我的两个数据源都正常工作.
我在此范围内设置了默认数据库.默认值为"DatasourceOne".
<cfquery>
SELECT UserID
FROM DatasourceOne.TableOne IN (SELECT Userid FROM DatasourceTwo.TableTwo )
</cfquery
Run Code Online (Sandbox Code Playgroud)
有关使用多个数据源的规则或准则是什么?
澄清
我本来应该问我如何在一个查询中使用两个数据库(而不是数据源).我相信你的答案会有所不同.我们确实将两个数据库设置为数据源,但我自己有点困惑.
编码cfqueryparam或cfprocparam时,cfsqltype是可选的.但是,我经常看到它编码.指定cfsqltype有什么好处吗?
我在使用CFSelenium/TestBox时遇到了问题.我正在使用Windows 7 VM,Coldfusion 10开发.我从https://github.com/teamcfadvance/CFSelenium/archive/master.zip下载了一份新的cfselenium副本.
我的文件结构是
wwwroot |
cfselenium |
Selenium-RC |
Selenium-server-standalone-2.46.0.jar
Selenium.cfc
Server.cfc
Testbox |
… various testbox files
MySite |
Tests|
Specs |
… my test files
seleniumtest.cfc
Application.cfc
Index.cfm
Run Code Online (Sandbox Code Playgroud)
MySite/Test/Application.cfc包括testbox /和cfselenium /的映射.
测试套件seleniumtest.cfc扩展了testbox.system.BaseSpec,其beforeAll()和afterAll()函数实例化selenium,启动它并将其拆除:
component extends="testbox.system.BaseSpec" {
function beforeAll( ){
// create Selenium class
selenium = new cfselenium.Selenium();
// Start it up.
selenium.start( "mysite", "*chrome" );
}
// executes after all suites+specs in the run() method
function afterAll(){
selenium.stop();
selenium.stopServer();
}
function run( testResults, testBox ){ …Run Code Online (Sandbox Code Playgroud) 问题:在移动版本上,图像在纵向模式下拉伸.如下所示,它看起来很压缩.
在横向模式下,图像看起来不会拉伸,看起来与网站的桌面版本完全相同.
我使用bootstrap,图像有类img响应,它不起作用.
下面是我写的css.我尝试过设置background-size:contains,以及其他一些方法,但没有提供所需的结果.该项目使用Coldfusion和Mura(CMS).
UPDATE
正在使用以下css以使其响应:
@media (min-width: 1024px) #homepage .carousel .item img {
width:100%;
height:auto;
}
media (min-width:769px) and (max-width:980px) {
#homepage .carousel .item img {
max-width: 100%;
min-height: 100%;
height: auto;
margin-top: 154px !important;
}
}
@media (max-width: 751px) and (orientation: landscape) {
.override-hidden-xs1 {
display: block;
}
.carousel-inner {
width: 100% !important;
}
.fixNext {
margin-right: 0px;
}
.carouselCaption {
margin-top: 120px !important;
}
.h4Font {
font-size: 16px !important;
}
.upcoming-events-image { …Run Code Online (Sandbox Code Playgroud) 我正在从ColdFusion 9升级到ColdFusion 2016,我的网络服务突然不再起作用了.我相信这是因为Axis 2是在Cold Fusion 10中引入的,并且它使我现有的Web服务无法正常运行.
即使我在ColdFusion Administrator中将Web服务版本设置为1,它仍然无效.
我称这些Web服务的方式是createObject这样的功能:
<cfscript>
objSoapHeader = XmlParse("<wsse:Security mustUnderstand=""true"" xmlns:wsse=""http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd""><wsse:UsernameToken><wsse:Username>USERNAME</wsse:Username><wsse:Password>PASSWORD</wsse:Password></wsse:UsernameToken></wsse:Security>");
Application.UserWebService = CreateObject("webservice", PATH & "Requests/UserService.asmx?WSDL");
addSOAPRequestHeader(Application.UserWebService,"","",objSoapHeader,true);
// Get the .Net resources
Application.NetResources = Application.UserWebService.GetNetResources();
</cfscript>
Run Code Online (Sandbox Code Playgroud)
我收到的错误是:
无法执行Web服务调用GetNetResources.
调用Web服务操作时返回的错误是:java.lang.RuntimeException:从数据源获取解析器时出错:LanguageHeader不能为null!
它表明LangaugeHeader不可能null.WSDL显示与GetNetResources操作关联的两条消息:
<wsdl:portType name="UserServiceSoap">
<wsdl:operation name="GetNetResources">
<wsdl:input message="tns:GetNetResourcesSoapIn"/>
<wsdl:output message="tns:GetNetResourcesSoapOut"/>
</wsdl:operation>
</wsdl:portType >
Run Code Online (Sandbox Code Playgroud)
但是,在查看消息列表时,我可以看到与GetNetResources相关的三条消息:
<wsdl:message name="GetNetResourcesSoapIn">
<wsdl:part name="parameters" element=tns:GetNetResources"/>
</wsdl:message>
<wsdl:message name="GetNetResourcesSoapOut">
<wsdl:part name="parameters" element=tns:GetNetResourcesResponse"/>
</wsdl:message>
<wsdl:message name="GetNetResourcesLanguageHeader">
<wsdl:part name="parameters" element=tns:LanguageHeader"/>
</wsdl:message>
Run Code Online (Sandbox Code Playgroud)
如果操作只指定了两条消息,那么WSDL文件中第三条消息与操作相关联的位置是什么?
看起来LanguageHeader参数在ColdFusion 2016中是绝对必需的,所以为什么它在ColdFusion …
coldfusion ×10
coldfusion-9 ×2
sql ×2
arrays ×1
axis ×1
axis2 ×1
caching ×1
cfc ×1
cfml ×1
css ×1
duplicates ×1
html ×1
jquery ×1
railo ×1
selenium ×1
web-services ×1
wsdl ×1