spring项目中遇到的问题
来源:互联网 发布:淘宝店铺首页设计尺寸 编辑:程序博客网 时间:2024/05/16 07:37
获取span中value参数的值
$(this).find('.glyphicon').attr('value')
输入为大于0的数的正则表达式
var re=/^(0\.[0-9]\d*|[1-9]\d*(\.\d+)?)$/; if (!re.test($("input[name='currencyRate']").val().trim())){ $.growlUI('提示', '输入格式不对'); return false; }
jsp中进行调试 debugger;
mysql主键自动增加
<insert id="insert" useGeneratedKeys="true" keyProperty="id" parameterType="com.pandaw.model.CouponItem"> <!-- WARNING - @mbggenerated This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Mon Sep 22 12:02:47 CST 2014. --> insert into coupon_item (id, title, value, type, rule, start_time, end_time) values (#{id,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR}, #{value,jdbcType=INTEGER}, #{type,jdbcType=VARCHAR}, #{rule,jdbcType=VARCHAR}, #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}) </insert>
日期字符串在jsp中进行比较
<td> <c:set var="nowDate" value="<%=System.currentTimeMillis()%>"></c:set> <c:if test="${nowDate -couponItem.endTime.time < 0 && nowDate -couponItem.startTime.time>0 }"> 进行中</c:if> <c:if test="${nowDate- couponItem.endTime.time > 0}"> 已结束</c:if> <c:if test="${nowDate-couponItem.startTime.time < 0}"> 未开始</c:if> </td>
ajax应用
jsp中的js
$.ajax({ type:'post', url:'${contextPath}/wx/order/verifyScores', data:{ scoresNum:scoresText }, success:function(data){ if(data.status == 1){ $('#addtoScores').modal('hide'); $('#scoresPrice').text(data.data); $('#defineFont1').text(data.data); var p = $('#realPriceHidden').val()*100 - $('#defineFont').text()*100 - $('#defineFont1').text()*100; p/=100; if(p < 0){ p = 0; } $('#realPriceFont').text(p); //$('#defineScores').modal(); }else if(data.status == 2){ $('#addtoScores').modal('hide'); alert('积分不足'); }else if(data.status == 3){ alert('该优惠卷未开始'); }else if(data.status == 4){ alert('该优惠卷已过期'); }else if(data.status == 5){ alert('该优惠卷已使用'); } }, error:function(){ alert('网络连接超时1'); } }); });java控制代码
@SuppressWarnings("unchecked")@RequestMapping(value = "/verifyScores")@ResponseBodypublic Map<String,Object> verifyScores(@RequestParam String scoresNum,@OpenId String openId) throws Exception{Map<String, Object> res = new HashMap<String, Object>();res.put("status", 1);res.put("data", WxUtil.scoreToMoney(Integer.parseInt(scoresNum))); User2 user = new User2(); user=user2Service.selectByOpenId(openId); if(Integer.parseInt(scoresNum)>user.getScore()){ res.put("status", 2);//积分不足 }return res;}
0 0
- spring项目中遇到的问题
- Spring+Hibernate+Struts项目中Tomcat常遇到的问题
- Spring+Hibernate+Struts项目中Tomcat常遇到的问题
- Spring+Hibernate+Struts项目中Tomcat常遇到的问题
- springmvc+spring+mybatis项目部署中遇到的问题
- 新建一个maven spring boot项目中遇到的问题
- 项目中遇到的问题
- 项目中遇到的问题
- 项目中遇到的问题
- 项目中遇到的问题
- 项目中遇到的问题
- 项目中遇到的问题
- 项目中遇到的问题
- 项目中遇到的问题
- 项目中遇到的问题
- 项目中遇到的问题
- 项目中遇到的问题
- 项目中遇到的问题
- shell 字符串处理
- 立足本土以快见长,移动信息化服务商取胜之道
- TCP Client实现对mysql的操作
- Android localsocket 的基础和使用实践: 01
- jstl 应用
- spring项目中遇到的问题
- JDBC连接数据库
- 不要KPI?别逗了!
- arm-linux 交叉编译 mp4v2
- nio简单学习
- bash参考手册之六(Bash特性)续二
- 将VxWorks移植到AT91RM9200处理器之上
- 串口调试Linux虚拟机
- Android开发第1篇 环境搭建