1.传统方式JSON输出这一点跟传统的Servlet的处理方式基本上一模一样,代码如下01public void doAction() throws IOException{02 HttpServletResponse response=ServletActionContext.getRespons...
分类:
Web程序 时间:
2015-02-16 18:10:36
阅读次数:
223
1. 不带任何提示关闭窗口的js代码代码如下:关闭2.自定义提示关闭代码如下:3.关闭当前页面:代码如下:关闭如果是按钮则:Response.Write("");这样点关闭的时候就不会弹出如当前窗口正试图关闭的对话框了.那么怎么样当用户点浏览器的最大化最小化关闭按钮中的关闭按钮时也弹出关闭的确认对话...
分类:
Web程序 时间:
2015-02-15 19:24:23
阅读次数:
178
一般处理程序后台 //获取页面参数 string count = context.Request["startCount"]; string descri = context.Request["starDescri"]; //返回处理结果 context.Response.Write("true"....
分类:
Web程序 时间:
2015-02-15 18:02:17
阅读次数:
164
//弹出对话框跳转 Response.Write(""); //刷新当前页面 Page.ClientScript.RegisterClientScriptBlock(this.GetType(), Guid....
分类:
其他好文 时间:
2015-02-15 17:48:39
阅读次数:
133
问题及代码:
Problem Description
How far can you make a stack of cards overhang a table? If you have one card, you can create a maximum overhang of half a card length. (We're assuming that the cards must ...
分类:
其他好文 时间:
2015-02-15 13:33:05
阅读次数:
205
后台控制 //过滤器已经实现编码问题
String op = request.getParameter("op");
if("addCategory".equals(op)) { addCategory(request,response);
} else if("showAllCategories"...
分类:
编程语言 时间:
2015-02-14 21:23:43
阅读次数:
182
文件上传时,关键点是form表单的enctype属性值设置为multipart/form-data,旨在告诉服务器,向服务器发送二进制数据;
文件下载时,则是在响应的response.setContentType("application/pdf")方法中设置文件的后缀格式,以及在响应头信息中指明文件的名称response.addHeader("Content-Disposition", "attachment; filename=\"" + filename + "\"")告诉浏览器该如何解析该流文件。...
分类:
其他好文 时间:
2015-02-14 12:24:21
阅读次数:
465
环境:Python2.7.9 / Sublime Text 2 / Chrome1.url访问,直接调用urllib库函数即可import urllib2url='http://www.baidu.com/'response = urllib2.urlopen(url)html=response.r...
分类:
编程语言 时间:
2015-02-14 12:16:42
阅读次数:
5893
如何在浏览器网页中显示word文件内容把word文件读到byte[]中,再Response.OutputStream.Write(bytes)到客户端去Page_Load事件中写: //FileStream fs = new FileStream("c:\\1.doc", FileMode...
分类:
Web程序 时间:
2015-02-13 18:23:38
阅读次数:
184
项目用的是Beego的1.4.2。但是最近发现cdn会把项目中的40x或者50x的页面缓存住。
研究了下Beego的源码,然后经过测试后发现,在生产环境下,当请求的页面出错时,返回的页面的状态码40x或者50x会被统一改为200。
这个是因为开发者谢大将写入response的状态码的那行给注释了。
要是用Beego的同僚注意了,这个地方得自己处理下。
如下处理即可:
在main.go中:...
分类:
其他好文 时间:
2015-02-12 22:55:07
阅读次数:
372