在我的异常处理文件中,我将状态代码设置为404,然后为错误页面(想想失败鲸鱼)渲染n个HTML页面.
<cfheader statuscode="404" statustext="Application Exception">
<html><head><title>Error</title></head><body><h1>There was an error yo!</h1></body></html>
Run Code Online (Sandbox Code Playgroud)
这显然过于简化,但只是为了确保一切都得到了证明.
我发现,从ASP.NET请求中,他们可以设置变量"Response.TrySkipIisCustomErrors = true",以防止IIS显示自己的错误页面.
Coldfusion中的某个人怎么做呢/我怎么能告诉IIS停止它认为它比我的诡计更好.
使用jQuery mobile,我使用列表视图,其中包含前一个和下一个链接以进行分页.一切正常,但我不希望将prev和next页面添加到历史堆栈中.这个想法是回击将只到实际的前一页.
我发现这样做的唯一方法是将data-rel ="dialog"添加到a标签中,但我不希望它成为弹出式对话框.
否则我试着添加
$.mobile.nonHistorySelectors="dialog,pagination"
Run Code Online (Sandbox Code Playgroud)
到mobileinit事件,将属性data-rel ="pagination"添加到a标签.但是这只会在单击链接时抛出错误(即使没有将nonHistorySelectors添加到mobileinit事件,也会发生错误).
编辑:
我发现的最接近的是这个JS
<script type="text/javascript">
$(".page-prev").click(function(e) {
e.stopPropagation();
e.preventDefault();
$.mobile.changePage(this.href, {changeHash:false, reverse:true});
});
$(".page-next").click(function(e) {
e.stopPropagation();
e.preventDefault();
$.mobile.changePage(this.href, {changeHash:false});
});
</script>
Run Code Online (Sandbox Code Playgroud)
和这个HTML
<a href="/blog?page=1" class="page-prev" data-role="button" data-icon="arrow-l">Prev</a>
<a href="/blog?page=3" class="page-next" data-role="button" data-icon="arrow-r">Next</a>
Run Code Online (Sandbox Code Playgroud)
这似乎很好地保持浏览器历史记录不被更新,但有时当点击下一页时,滑动的页面会做一些时髦的事情,例如加载/滑动两次.此外,它没有做到的一件事是,如果我从这里导航到一个页面并返回,它将返回到第1页.
我试图在变量中GZip内容输出到浏览器.首先,我将这个变得非常简单,而不用担心不支持gzip的浏览器.此外,我通过研究我可以在网上找到的几种方法把它放在一起.其中一些人可能正在阅读这个问题.
<cfsavecontent variable="toGZIP"><html><head><title>Test</title></head><body><h1>Fear my test</h1></body></html></cfsavecontent>
<cfscript>
ioOutput = CreateObject("java","java.io.ByteArrayOutputStream");
gzOutput = CreateObject("java","java.util.zip.GZIPOutputStream");
ioOutput.init();
gzOutput.init(ioOutput);
gzOutput.write(toGZIP.getBytes("UTF-8"), 0, Len(toGZIP.getBytes()));
gzOutput.finish();
gzOutput.close();
ioOutput.flush();
ioOutput.close();
toOutput=ioOutput.toString("UTF-8");
</cfscript>
<cfcontent reset="yes" /><cfheader name="Content-Encoding" value="gzip"><cfheader name="Content-Length" value="#ArrayLen( toOuptut.getBytes() )#" ><cfoutput>#toOuptut#</cfoutput><cfabort />
Run Code Online (Sandbox Code Playgroud)
但我在Firefox(以及Chrome和Safari)中出错
内容编码错误
您尝试查看的页面无法显示,因为它使用无效或不受支持的压缩形式.
有人有什么想法吗?
操作系统:Mac OX-X Snow Leopard
CF:9-Dev
Webserver:Apache
解
<cfsavecontent variable="toGZIP"><html><head><title>Test</title></head><body><h1>Fear my test</h1></body></html></cfsavecontent>
<cfscript>
ioOutput = CreateObject("java","java.io.ByteArrayOutputStream");
gzOutput = CreateObject("java","java.util.zip.GZIPOutputStream");
ioOutput.init();
gzOutput.init(ioOutput);
gzOutput.write(toGZIP.getBytes(), 0, Len(toGZIP.getBytes()));
gzOutput.finish();
gzOutput.close();
ioOutput.flush();
ioOutput.close();
toOutput=ioOutput.toByteArray();
</cfscript>
<cfheader name="Content-Encoding" value="gzip"><cfheader name="Content-Length" value="#ArrayLen(toOutput)#" ><cfcontent reset="yes" variable="#toOutput#" /><cfabort />
Run Code Online (Sandbox Code Playgroud) 使用Coldfusion 8/9,我将如何管理IIS7.例如:
我正在建立一个网站生成器,当有人填写表格时,将生成一个网站.此过程中的一个步骤是创建具有特定主机头/ ip绑定的IIS站点.另一步可以是允许用户上传SSL证书.这可能是不可能的,我不确定.但我知道应该有一种与IIS7交互的方法.
这可能很可怕,我不确定。
假设我们有一个带有工作目录的回购“产品”
/product
/product/command.script
/product/config/ (bare git repo)
Run Code Online (Sandbox Code Playgroud)
和一个带有工作目录的 repo "config"
/config
/config/config.json
Run Code Online (Sandbox Code Playgroud)
command.script 文件具有与裸存储库交互的操作。前任。运行 command.script BRANCH1 将运行命令
git show BRANCH1:config.json
Run Code Online (Sandbox Code Playgroud)
有什么办法可以让“/product/config/”文件夹成为“product”repo的子模块,这样当“product”repo被克隆时,“config”repo也将被克隆
git clone --bare [config origin here] config
Run Code Online (Sandbox Code Playgroud)
从它的来源开始,当“product”repo 被获取时,“/product/config”子模块可以被获取
git fetch origin '*:*'
Run Code Online (Sandbox Code Playgroud)
或者这是应该通过某种钩子处理的东西吗?
new Mongo.ObjectID('18986769bd5eaaa42cb565b1') == new Mongo.ObjectID('18986769bd5eaaa42cb565b1')
Run Code Online (Sandbox Code Playgroud)
返回假
new Mongo.ObjectID('18986769bd5eaaa42cb565b1').toString() == new Mongo.ObjectID('18986769bd5eaaa42cb565b1').toString()
Run Code Online (Sandbox Code Playgroud)
返回真
这是一个错误,一个功能还是我只需要使用 valueOf() 处理这些并在我需要使用数据库时将其从字符串转换回来?
我正在编写一个我想经常运行的计划任务.
问题是,如果服务器遇到高流量负载,我不希望运行此任务.
还有什么方法可以从java获取free/total/max内存来试图找出这个任务是否应该继续?
coldfusion ×4
iis ×2
iis-7 ×2
git ×1
git-bare ×1
gzip ×1
java ×1
javascript ×1
jquery ×1
meteor ×1
mongodb ×1
server-load ×1