我有一个使用CF8和Fusebox 5的站点.无论何时我需要为站点添加新功能,我通常都需要为circuit.xml.cfm添加一个新的保险丝,用于控制器,模型或视图,或者全部.要启用这些新功能/页面,请转到以下网址:
?fusebox.load=true&fusebox.parse=true&fusebox.password=password&fusebox.loadclean=true
Run Code Online (Sandbox Code Playgroud)
最后一个参数是我最近选择的参数,并确定使用它可以启用我的新保险丝; 没有它,新的保险丝不被识别.但是,当我这样做时,删除之前生成的所有解析文件.这不是什么大问题,因为它们在第一次需要时会动态重新生成,但我有一些页面在访问时会返回错误.该错误表示目录未找到,但它们在那里,每次出现都是因为解析文件不存在.
以下是堆栈跟踪的一个错误示例:
Error - Parsed File or Directory not found.
Date/Time: Apr 25 2009 12:26:02
Type: fusebox.missingParsedFile
Message: Parsed File or Directory not found.
Detail:
Attempting to execute the parsed file 'login.logout.cfm' threw an error. This can occur if the parsed file does not exist in the parsed directory or if the parsed directory itself is missing.
Stack Trace:
coldfusion.runtime.CustomException: Parsed File or Directory not found.
at coldfusion.tagext.lang.ThrowTag.doStartTag(ThrowTag.java:124)
at coldfusion.runtime.CfJspPage._emptyTag(CfJspPage.java:2644)
at cffusebox52ecfm1214986498.runPage(C:\example.com\fb5core\fusebox5.cfm:216)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:192)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:366) …Run Code Online (Sandbox Code Playgroud) 我有一个需要人类可读的单词列表,例如FirstName到First Name,LastName到Last Name,在某些情况下,像ARB这样的首字母缩略词保持原样.后者最近被引入,并且由于我们的正则表达式返回AR Bs而导致显示问题.这就是我们所拥有的,我知道这对于首字母缩略词是不够的:
([A-Z][a-z]+)
Run Code Online (Sandbox Code Playgroud)
我在SO和其他网站上找到了能够使用首字母缩略词的其他表达式,但是它们适用于首字母缩略词在字符串中而不是整个字符串的字符串.我可以做简单的正则表达式,但这对我的技能来说太棘手了.我会提供其他测试示例,如果我有它们,但所有字符串工作正常,除了新的ARBs.谢谢.
更新:这是代码用法
string friendlyName = Regex.Replace(field.Name, "([A-Z][a-z]+)", " $1", RegexOptions.Compiled).Trim();
Run Code Online (Sandbox Code Playgroud)