开发异常与解决
常见问题处理
闭着眼睛写BUG
圆规为什么能画圆?因为脚在走,心不变
展开
-
js 中将string转化为double,避免产生多位数和计算精度损失。
整理一下,在写js代码时,我们经常会因为带有小数的运算而头痛。因为它会出现产生多位数和计算精度损失。在Java代码中我们可以有以下3种方式转化parseFloat("123.2")parseInt("121");parseDouble()但是我们找了JavaScript中的方法,我们发现js中只有将String转为int、float的方法。并没有转化为double的。这时怎原创 2015-09-23 19:53:58 · 88000 阅读 · 0 评论 -
防止表单重复提交的问题
最近老大让我处理一下订单重复提交的问题,不会做,自己网上默默的查资料,发现各式各样的,然后自己整理成一下,方便以后用。首先我们分析下原因:1、在网络延迟的情况下让用户有时间点击多次提交按钮导致表单重复提交。2、表单提交后用户点击浏览器的刷新导致表单重复提交3、用户提交表单后,点击浏览器的【后退】按钮回退到表单页面后进行再次提交总得来说都是,服务器在来不及处理的情原创 2015-10-08 15:26:13 · 1832 阅读 · 0 评论 -
springboot 继承shiro 使用redis缓存 @Value 标签无效
今天在使用springboot 集成shiro+redis,出现了一个问题,就是@Value 标签无效@Configurationpublic class ShiroConfig { private final int SESSION_TIMEOUT= 180*1000;// Session 超时失效时间,秒 private final int COOKIE_TIMEOUT =...原创 2019-06-29 18:59:01 · 400 阅读 · 0 评论 -
mybatis-plus配置找不到Mapper接口路径的坑
mybatis-plus今天遇到一个问题,就是mybatis 没有读取到mapper.xml 文件。特此记录一下,问题如下:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.husy.mapper.SystemUserMapper.findUserByName at co...原创 2019-06-28 23:39:29 · 69348 阅读 · 21 评论 -
mybatis拦截器找不到接口方法的问题
mybatis分页拦截器报错:org.apache.ibatis.exceptions.PersistenceException: ### Error opening session. Cause: org.apache.ibatis.plugin.PluginException: Could not find method on interface org.apache.ibatis.ex...原创 2019-06-26 14:07:58 · 2709 阅读 · 0 评论 -
Springboot使用java -jar启动后过Servlet过滤器失效的问题
@WebServlet,@WebFilter和@WebListener 使用问题昨天发现一个问题。在Springboot ,使用 @WebFilter 配置过滤器时。发现jar包和war部署的效果不一样。使用 war 包部署到 外部的Tomcat 容器, 我们配置的过滤器,会有效果。但是使用 jar 包,使用 java -jar 命令部署,结果过滤器没有效果。经过查阅,了解到:@WebS...原创 2019-06-12 15:25:27 · 959 阅读 · 0 评论 -
mybatis.xml中判断数字 0 的问题
mybatis的if判断integer问题:解决Bug 时,发现一个问题。mybatis 传入Integer对象 时,if 判断 无法断 0,如下<if test="chargeStatus != null and chargeStatus== 0 "> AND c.charge_status = #{chargeStatus}</if>经测试发现myb...原创 2019-05-22 16:43:23 · 6150 阅读 · 1 评论 -
Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure
最近启动项目,连接自己本地数据库时,出现了如下异常ERROR [com.alibaba.druid.pool.DruidDataSource] - create connection error, url: jdbc:mysql://127.0.0.1:3306/db_local?serverTimezone=UTC&useSSL=false&autoReconnect=tru...原创 2019-04-21 13:11:51 · 16057 阅读 · 2 评论 -
Error creating bean with name 'redisTemplate' defined in URL
最近使用Spring 整合Redis出现了这类问题:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redisTemplate' defined in URL [file:/E:/workspace/spring-ssm/target/classes/spring/s...原创 2019-04-21 13:06:15 · 9212 阅读 · 2 评论 -
Error creating bean with name 'xxx.xx.xRequestMappingHandlerAdapter' Instantiation of bean failed
最近将maven 项目中的spring 版本更新到了5.1.6.RELEASE,但是项目启动时,出现了如下问题ERROR org.springframework.web.context.ContextLoader - Context initialization failedorg.springframework.beans.factory.BeanCreationException: Er...原创 2019-04-21 12:58:57 · 1560 阅读 · 1 评论 -
Error configuring application listener of class org.springframework.web.context.ContextLoaderListene
最近在搭建项目,遇到启动Tomcat时 遇到如下问题:严重: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener具体异常如下:严重: Error configuring application listener of class or...原创 2019-04-21 12:52:02 · 544 阅读 · 0 评论