上一页 1 ··· 5 6 7 8 9 10 下一页

2013年7月22日

spring+jpg环境下,spring实现文件下载web实现通用的文件下载方法

摘要: response.setCharacterEncoding("UTF-8"); response.setContentType("text/html"); javax.servlet.ServletOutputStream ou = response.getOutputStream(); //文件名 // String filename=new String(fileName.getBytes("ISO8859_1"),"GB2312").toString(); //路径 java.io.File file = new java.io.File(urlandfile); if (!file.exists()) { System.out.println(file.getAbsolutePath() + " 文件不能存在!"); msg="unexists"; return msg; } // 读取文件流 阅读全文

posted @ 2013-07-22 12:51 qgc 阅读(412) 评论(0) 推荐(0)

2013年7月18日

spring+jpg环境下,spring实现文件上传

摘要: MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; CommonsMultipartFile file = (CommonsMultipartFile) multipartRequest.getFile("file"); // String name = multipartRequest.getParameter("name"); String realFileName = file.getOriginalFilename(); //System.out.println("获得文件名:" + realFileName); // 获取路径 String ctxPath = request.getSession().getServletContext().getRealPath("/") + "upload/"; // 创建文件 File dirPath = new File(ctxPath); 阅读全文

posted @ 2013-07-18 22:56 qgc 阅读(266) 评论(0) 推荐(0)

实现jsp网页设为首页功能

摘要: var url = location.href; var browser_name = navigator.userAgent; if(browser_name.indexOf('Chrome')!=-1){ alert("此操作被浏览器拒绝!\n请在浏览器地址栏输入“chrome://settings/browser”,进行主页设置。") }; try { this.style.behavior = "url(#default#homepage)"; this.setHomePage(url); } catch (e) { if (window.netscape) { try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); } catch (e) { alert("此操作被浏览器拒绝!\n请在 阅读全文

posted @ 2013-07-18 19:36 qgc 阅读(536) 评论(0) 推荐(0)

实现jsp网站添加到收藏夹

摘要: var ctrl = (navigator.userAgent.toLowerCase()).indexOf('mac') != -1 ? 'Command/Cmd': 'CTRL'; if (document.all) { window.external.addFavorite(location.href, document.title) } else if (window.sidebar) { window.sidebar.addPanel(document.title, location.href, "") } else { alert('您可以尝试通过快捷键' + ctrl + ' + D 加入到收藏夹~') } 阅读全文

posted @ 2013-07-18 19:31 qgc 阅读(541) 评论(0) 推荐(0)

2013年7月17日

web/jdbc数据库带实例名连接2008

摘要: --------------------------数据库带实例名连接2008------------------------------------- 阅读全文

posted @ 2013-07-17 20:35 qgc 阅读(158) 评论(0) 推荐(0)

子iframe刷新父ifrmae的方法

摘要: parent.location.href=""; parent.location.reload(); 阅读全文

posted @ 2013-07-17 20:34 qgc 阅读(158) 评论(0) 推荐(0)

js判断浏览器类型

摘要: function getExplorerType() { var explorer = window.navigator.userAgent ; //ie 浏览器 if (explorer.indexOf("MSIE") >= 0) { alert("ie"); } //firefox 火狐浏览器 else if (explorer.indexOf("Firefox") >= 0) { alert("Firefox"); } //Chrome 谷歌浏览器 else if(explorer.indexOf("Chrome") >= 0){ alert("Chrome"); } //Opera 浏览器 else if(explorer.indexOf("Opera") >= 0) { alert("Opera"); } //Safari else if(explorer.indexOf("Safari") >= 0){ alert("Safari") 阅读全文

posted @ 2013-07-17 20:33 qgc 阅读(234) 评论(0) 推荐(0)

解决ie6不支持position: fixed;导致无法滚动的办法

摘要: //解决浏览器问题 var count=document.documentElement.scrollTop+document.body.scrollTop; var newheight=parseInt(count)+parseInt(110); $("#im").attr("style","background-image:url('image/big_bg.png'); border:none; position:fixed; _position:absolute; z-index:99; margin-left:800px; padding: 3px; text-align: center; width:200px;height: 150px;top:"+newheight+"px;"); }; /* /*注册事件*/ if(document.addEventListener){ //mousewheel OR DOMMouseScroll document.addEventListener('DOMMouseSc 阅读全文

posted @ 2013-07-17 20:29 qgc 阅读(327) 评论(0) 推荐(0)

jsp转发action的问题找不到acton

摘要: stturs.xml: struts2 org.apache.struts2.dispatcher.FilterDispatcher struts2 /* REQUEST FORWARD 阅读全文

posted @ 2013-07-17 20:29 qgc 阅读(376) 评论(0) 推荐(0)

JS鼠标滚动事件

摘要: var scrollFunc=function(e){ //获取函数代码 e=e || window.event; //判断浏览器兼容哪个方法 if(e.wheelDelta)//IE/Opera/Chrome alert("监听成功!"); else if(e.detail)//Firefox alert("监听成功!"); }; /*注册事件*/ if(document.addEventListener) document.addEventListener('DOMMouseScroll',scrollFunc,false);//W3C else document.onmousewheel=scrollFunc;//IE/Opera/Chrome 阅读全文

posted @ 2013-07-17 20:27 qgc 阅读(620) 评论(0) 推荐(0)

上一页 1 ··· 5 6 7 8 9 10 下一页

导航