标签: cfwheels

在web.config中的IIS7"格式错误的XML"上的HTTP错误500.19

我被迫从出厂默认设备重建我的机器.一切都应该是相同的,IIS版本(7.5),操作系统(Windows 7)和我的网站文件.但是,有些不同,因为在配置我的网站并在我的浏览器中提取本地网站后,我收到以下错误...

HTTP错误500.19 - 内部服务器错误无法访问请求的页面,因为页面的相关配置数据无效.错误代码0x8007000d

当我查找错误代码0x800700d时,它告诉我......

分析:出现此问题的原因是ApplicationHost.config文件或Web.config文件包含格式错误的XML元素.要解决此问题,请参阅解决方案1.

然后提供...的分辨率

建议的解决方案:从ApplicationHost.config文件或Web.config文件中删除格式错误的XML元素.

但是我没有看到格式错误的XML,当我完全删除web.config文件时,网站加载但URL重写不起作用(显然).此外,即使我从web.config文件中删除所有XML,将其留空,我也会收到同样的错误.它似乎存在web.config文件存在的问题.

作为参考,这是我的web.config的内容......

<?xml version="1.0" encoding="UTF-8"?>

<!-- this file can be deleted if you're not planning on using URL rewriting with IIS 7. -->
<!-- you can add your own files and folders that should be excluded from URL rewriting by adding them to the "pattern" below. -->
<!-- please read the online documentation on http://cfwheels.org for more information about URL rewriting. -->

<!-- SET ENABLED TO …
Run Code Online (Sandbox Code Playgroud)

iis-7 cfwheels

20
推荐指数
1
解决办法
2万
查看次数

如何在两个结构上进行"深度比较"或"差异"?

(这是一个冷血问题)

我有两个不同的结构,可能包含或不包含相同的数据,我希望能够看到它们是否存在!我的结构将始终包含简单值(数字,字符串或布尔值),因为它们是使用DeserializeJSON创建的,所以希望这可以轻松完成.

我在这里发现了Ben Nadel的帖子,但这种技术似乎对我不起作用.这是我到目前为止所尝试的(其中有一些cfwheels代码):

itemA = DeSerializeJSON(model("itemsnapshot").findByKey(4).json);
itemB = DeSerializeJSON(model("itemsnapshot").findByKey(5).json);

StructDelete(itemA,"updatedAt");
StructDelete(itemB,"updatedAt");
StructDelete(itemA,"createdAt");
StructDelete(itemB,"createdAt");

writedump(itemA);
writedump(itemB);

out = itemA.Equals(itemB);
writedump(out);
Run Code Online (Sandbox Code Playgroud)

结果如下:

Struct
code string C112
companyid number 1
cost number 5000
deletedAt string 
description string Nightstand
id number 70634
itemtypeid string 13
projectid number 8
unittypeid string

Struct
code string C112
companyid number 1
cost number 5000
deletedAt string 
description string Nightstand
id number 70634
itemtypeid string 13
projectid number 8
unittypeid string 

boolean false
Run Code Online (Sandbox Code Playgroud)

因此,正如您将在上面看到的那样,尽管Structs中的数据看起来完全匹配,但它们不会通过Equals()测试.

还有其他人成功完成了吗?

java coldfusion railo cfwheels cfml

8
推荐指数
1
解决办法
2381
查看次数

使用cfwheels,coldfusion和cfspreadsheet创建一个带有非标准列名(带空格)的Excel文件导出

这更像是一个操作方法,而不是一个实际的问题.(我搜索过,找不到解决办法,所以我想出了这个)

我需要创建一个excel文件导出,允许用户:

  1. 使用原始表格中的表单过滤数据
  2. 将结果从原始表导出到excel文件.
  3. 允许非标准列名称包含空格和一些特殊字符.
  4. 在某些列中格式化导出的数据,同时保留原始表值(用于过滤).

coldfusion cfwheels coldfusion-10 cfspreadsheet

7
推荐指数
1
解决办法
138
查看次数

可以在Application变量中存储大对象(例如java组件)吗?

我正在开发一个应用程序,它创建并存储与应用程序范围中的本地XMPP服务器的连接.连接方法存储在cfc中,以确保Application.XMPPConnection在每次使用时都已连接并授权,并利用连接向用户发送实时事件.据我所知,这工作正常.但它没有在任何压力下进行测试.

我的问题是:这个设置会在以后引起问题吗?我只是问,因为我找不到其他人以这种方式使用Application变量的证据.如果我不使用railo,我将使用CF的事件网关来完成相同的任务.

coldfusion railo cfwheels cfml

6
推荐指数
1
解决办法
484
查看次数

使用web配置从url中删除index.cfm

快速提问 -

目前我的网址看起来像这样: index.cfm/camp/another-test

我希望他们看起来像这样: camp/another-test

我可以使用我的.htaccess在apache上做到这一点,但我需要能够使用web.config在iis7上完成.到目前为止,这是我的重写:

<rewrite>
  <rules>
    <rule name="Remove index.cfm" enabled="true">
      <match url="^(.*)$" ignoreCase="true" />
      <conditions logicalGrouping="MatchAll">
        <add input="{SCRIPT_NAME}" negate="true" pattern="^/(assets|files|miscellaneous|robots.txt|favicon.ico|sitemap.xml|index.cfm)($|/.*$)" />
      </conditions>
     <action type="Rewrite" url="/index.cfm/{R:1}" />
    </rule>
  </rules>
</rewrite>
Run Code Online (Sandbox Code Playgroud)

谢谢您的帮助!

coldfusion iis-7 web-config url-rewriting cfwheels

6
推荐指数
1
解决办法
1327
查看次数

在ColdFusion11中使用java类 - CreateObject函数的java对象类型是未知的

我有一些代码可以在Railo下运行,但我正试图让这个特定的应用程序在CF10和CF11上工作

这是一个cfWheels应用程序,我BCrypt.class/miscellaneous/目录中有一个文件.

在我的/events/onapplicationstart.cfm档案中,我有:

application.bCrypt = CreateObject( "java", "BCrypt", "/miscellaneous/" );
Run Code Online (Sandbox Code Playgroud)

这适用于Railo; 但在CF11中我得到了

The java object type is unknown for the CreateObject function.

Verify the type of your object when creating it and try again. 
Valid Types are : component | java | webservice | dotnet | com | corba | .NET


The error occurred in /Volumes/Documents/blah/public/events/onapplicationstart.cfm: line 8
Called from /Volumes/Documents/blah/public/wheels/global/cfml.cfm: line 111
Called from /Volumes/Documents/blah/public/wheels/events/onapplicationstart.cfm: line 388
6 : 
7 :     // BCrypt …
Run Code Online (Sandbox Code Playgroud)

coldfusion railo cfwheels coldfusion-10

6
推荐指数
1
解决办法
516
查看次数

带有CF轮和ColdFusion的Tuckey URL重写过滤器11

我接管了一个在ColdFusion 10中使用CF Wheels构建的应用程序,它被设计为在Linux上运行.它使用Tuckey URL Rewrite过滤器来清理URL.我正在尝试在Windows机器上设置它并使用ColdFusion 11,但我遇到了Tuckey URL Rewrite过滤器的问题.

问题是它切断mcfm文件扩展名,因此ColdFusion会抛出File Not Found错误,因为当然没有"rewrite.cf"文件.我还注意到在调试输出中CGI.PATH_TRANSLATED变量以CG结尾rewrite.cf,而CGI.PATH_INFO以"m/[无论目录路径]"结尾,所以过滤器正在切断它应该重写的文件名.当我使用重写URL的"to"部分中的"反向引用"来传递目录路径时,似乎只会发生这种情况rewrite.cfm.如果我只是重定向到一个普通的cfm,而不进行反向引用,它工作正常.其他测试重写规则也可以正常工作,重写状态在我的localhost上看起来很好.有人有主意吗?

下面是我的规则urlrewrite.xml以及搞乱的PATH_TRANSLATED和PATH_INFO变量的截图.除了转移到Windows和CF 11之外,另一个区别是我在wwwroot("portal")的子目录中运行应用程序,但我已经在wwwroot级别应用了过滤器和规则,并在重写规则中指定了目录.

<rule>
    <note>Apply CFWheels URL rewriting for portal.</note>
    <condition type="request-uri" operator="notequal">^/portal/$</condition>
    <condition type="request-uri" operator="notequal">^/portal/favicon.ico$</condition>
    <condition type="request-uri" operator="notequal">^/portal/cfide(.*)$</condition>
    <condition type="request-uri" operator="notequal">^/portal/images(.*)$</condition>
    <condition type="request-uri" operator="notequal">^/portal/javascripts(.*)$</condition>
    <condition type="request-uri" operator="notequal">^/portal/stylesheets(.*)$</condition>
    <condition type="request-uri" operator="notequal">^/portal/rewrite.cfm(.*)$</condition>
    <from>^/portal/(.*)$</from>
    <to type="passthrough" last="true">/portal/rewrite.cfm/$1</to>
</rule>
Run Code Online (Sandbox Code Playgroud)

Tuckey重写问题

coldfusion cfwheels tuckey-urlrewrite-filter

6
推荐指数
0
解决办法
182
查看次数

如何使用cfc对象的引用从另一个函数调用函数?

抱歉,这个问题短语.我无法找到更好的方式来描述它.但我的问题如下:

我有3个cfc,即settings.cfc,prices.cfc和helpers.cfc.这些cfc扩展了第4个cfc controller.cfc.helper.cfc如下:

<cfcomponent extends="Controller">
    <cffunction name="formatCurrency">
        <cfset formattedCurrency = 1 />    
        <cfreturn formattedCurrency>        
    </cffunction>
    <cffunction name="processTemplateVariables">
       <cfargument name="templateText" default="defaultText" >
       <cfset formatCurrency() />
       <cfreturn formattedCurrency >        
    </cffunction>
</cfcomponent>
Run Code Online (Sandbox Code Playgroud)

settings.cfc有一个setApplicationVariables方法,我们用它来设置应用程序级变量.在这个cfc中,我创建了一个helpers.cfc对象,并将该对象放入应用程序范围.settings.cfc如下:

<cfcomponent extends="Controller">
   <cffunction name="setApplicationVariables">    
      <cfset application.helpers = createObject("component","controllers.Helpers") />  
   </cffunction>
</cfcomponent>
Run Code Online (Sandbox Code Playgroud)

在应用程序启动时调用settings.cfc,然后创建helpers.cfc的对象并将其放入应用程序范围.

我们在controller.cfc中创建对ProcessTemplateVariables方法的引用,如下所示:

<cfcomponent extends="Wheels">
   <cfset getFormattedCurrency = application.helpers.processTemplateVariables >
</cfcomponent>
Run Code Online (Sandbox Code Playgroud)

在prices.cfc中,我们使用此引用来调用function processTemplateVariables它.但它does not call the function formatCurrency从processTemplateVariables内部调用,并抛出错误" variable formatCurrency is undefined ".

但如果我使用它application.helpers.processTemplateVariables(templateText="someText"),它的工作原理.
它也有效,当我使用cfinvoke如下:

<cfinvoke method="processTemplateVariables" component="controllers.helpers" templateText="someText" returnvariable="content">
Run Code Online (Sandbox Code Playgroud)

prices.cfc如下:

<cfcomponent …
Run Code Online (Sandbox Code Playgroud)

coldfusion cfwheels coldfusion-9

5
推荐指数
1
解决办法
2765
查看次数

在参数名称中使用连字符

我正在使用CFWheels和jquery mobile,我正在尝试将一些jquerymobile设置传递给一个linkto调用(主要是data-icon属性.我之前从未尝试过这个,但似乎ColdFusion不允许在参数名称中使用连字符.我的电话如下:

<cfset contentFor(actioncontent=linkTo(text='Login', route='login', data-icon='check')) />
Run Code Online (Sandbox Code Playgroud)

CFBuilder和Railo在连字符上抛出错误.Railo错误是:

左侧无效分配(railo.transformer.bytecode.op.OpDouble)

所以我的问题是:我是否正确地说参数名称中不允许使用连字符?此外,如果他们不被允许,有没有办法让连字符通过或我只需要创建锚标记?

coldfusion railo cfwheels jquery-mobile

4
推荐指数
1
解决办法
1302
查看次数

我可以在CF11中获得强大的XSS保护,我可以在不触及每个查询或输入的情况下应用于整个站点吗?

所以我目前正在使用CF11和CFWheels 1.1,"全局脚本保护"(GSP)服务器功能在覆盖XSS基础方面做得非常糟糕.我想扩展它以阻止JS的任何和所有标签/向量插入到数据库中.

CF11通过getSafeHTML()函数提供antiSamy保护,该函数应用application.cfc中指定的xml策略文件,但我仍然需要修改应用程序中的每个varchar cfqueryparam才能正确使用它?

有没有办法让CF11以与GSP功能类似的方式启用反侦察功能服务器或应用程序?我的意思是GSP会自动从提交给应用程序的输入中删除标签,而无需修改所有查询/表单操作.我想以同样的方式应用反歧义策略文件或getSafeHTML().

谢谢!

javascript xss coldfusion cfwheels antisamy

4
推荐指数
1
解决办法
432
查看次数