几秒后自动跳转页面
摘要:setInterval("settime()",1000); var i=10; function settime(){ i--; $("#time").html(i); if(i<=0){ window.location.href="MyJsp.jsp"; } }
阅读全文
posted @
2012-12-28 15:49
老茶壶
阅读(191)
推荐(0) 编辑
javascript去除空格
摘要://去除中间空格 String.prototype.Trim = function(){ return this.replace(/(^\s*)|(\s*$)/g, ""); } //去除左侧空格 String.prototype.LTrim = function(){ return this.replace(/(^\s*)/g, ""); } //去除右侧空格 String.prototype.RTrim = function(){ return this.replace(/(\s*$)/g, ""); }使用:if(name.LT
阅读全文
posted @
2012-12-23 11:33
老茶壶
阅读(148)
推荐(0) 编辑
struts2 验证码
摘要:step 1:public class SecurityImage { /** * 生成验证码图片 * * @param securityCode * 验证码字符 * @return BufferedImage 图片 */ public static BufferedImage createImage(String securityCode) { // 验证码长度 int codeLength = securityCode.length(); // 字体大小 int fSize = 15; int fWidth = fSize + 1; // 图...
阅读全文
posted @
2012-12-21 16:21
老茶壶
阅读(635)
推荐(0) 编辑
ibatis resultMap用法
摘要:ibatisresultmap是我们学习ibatis中非常重要的一个内容,在我个人看来,能否真正用好ibatis的一个关键,这就是resultmap。字面上理解,它就是结果集的映射,就是将返回的记录逐个字段的映射赋值给对象的属性上。其实如果没有特殊需求的话我们完全可以使用resultclass来代替它,因为如果字段与属性一模一样的话,查询出来数据集会自动匹配到resultclass指定的类的实例对象,如果字段名不在属性中的话,那这个字段将不会被返回的实例体类对象接受,相当于没有查询出这个字段一样的。每个resultmap都有一个自己的id,如果你在sqlmap.config中没有配置使用命名.
阅读全文
posted @
2012-12-21 15:25
老茶壶
阅读(5161)
推荐(0) 编辑
手机号码验证---正则表达式
摘要:function checkMobile(){ var isMobile = /^(13[0-9]|15[0-9]|18[0-9])\d{8}$/; var mobile = $("#mobilePhone").val(); if(!isMobile.test(mobile)){ $("#span_phone").html('请输入正确的手机号码'); } }
阅读全文
posted @
2012-12-21 14:20
老茶壶
阅读(207)
推荐(0) 编辑