
java学习总结
CloudsYy
这个作者很懒,什么都没留下…
展开
-
泛型可变参数实例
public class StringtoVariable { //泛型可变参数测试 public <T>void testString(T... strings) { System.out.println(); for (T string : strings) { System.out.print(" " +...原创 2019-12-02 18:07:44 · 248 阅读 · 0 评论 -
for 循环性能对比
public class TestFor { public static long startTime; public static long endTime; public static int a = 1; public static int b = 1; public static int c = 1; public static int d...原创 2019-11-30 11:08:49 · 376 阅读 · 0 评论 -
关于response的中文乱码,解决方案
PrintWriter out = response.getWriter();response乱码,可以加如下代码:response.setContentType("text/html");response.setCharacterEncoding("utf-8");另外注:之前遇到一个奇怪的问题,就是凡是用到printwrite这个对象,直接out.print("中文×××");页...原创 2019-02-20 18:18:17 · 518 阅读 · 0 评论 -
对于设置了拦截,又需要访问静态文件,怎样配置?
在controller上的如:@requestmapper("login") 相当于虚拟地址...return 是真是地址,若想跳到别的页面可以return "redirect ..."方式另外在页面上加上script的标签,如果没有找到,加载页面失败,页面会显示空白。静态文件的配置在springmvc.xml中配置:<mvc:default-servlet-handler/...原创 2019-02-20 18:11:01 · 263 阅读 · 0 评论 -
关于java.lang.IllegalAccessError: org.apache.commons.dbcp.DelegatingPreparedStatement.isClosed()Z
简单来说是mybatis包的问题,可以通过修改mybatis的版本为老一点的版本,另外commons-dbcp.jar与commons-pool.jar版本需要一致,对于这种问题应该多多看看jar包的官方文档。...原创 2019-02-20 18:02:28 · 698 阅读 · 0 评论 -
校验器校验的乱码问题
当校验器校验的乱码问题,重启机器,然后重新编译。但是前提需要已经加了编码如fileEncoding=utf-8,然后调试不好,总是乱码,可尝试采用此方法。注一:上传图片的时候,此处需要写的真实路径,虚拟路径只需要在tomcat中配置即可。String pic_path = "D:\\apache-tomcat-6.0.43\\upload\\";...原创 2019-02-20 17:56:42 · 507 阅读 · 0 评论 -
从页面传格林威治格式的时间到后台的处理
从页面传过来的时间为格林威治时间,例如:Thu Sep 21 11:56:46 CST 2017,而实体类里的是date字段,直接传给mybatis执行update会报错。解决方法就是在mybatis传入的时候,即在xml中加jdbcType=DATE,即可解决。createtime=#{itemsList.createtime,jdbcType=DATE}注:使用jdbcType时,因#符号...原创 2019-02-20 17:55:25 · 625 阅读 · 0 评论 -
涉及到多条sql语句查询
当涉及到多条sql语句查询的时候,需要在jdbc.url参数后面加&allowMultiQueries=true,默认的只能查询一条sql语句,所以可能会报这样的错误是:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the r...原创 2019-02-20 17:54:22 · 583 阅读 · 0 评论 -
在调试页面时,如若发现传值传不进来
在调试页面时,如若发现传值传不进来,则查看页面input name的值和controller的pojo或者包装类是否类型名是否一致,另外检查包装中的get和set方法的方法名与其他的方法名是否相似,如若是需要修改一下...(因为本人比较懒,且这些都是很久之前总结的,都是直接复制过来,故没有任何多余的描述,如有任何需要讨论不懂或高见的,就评论见。)...原创 2019-02-20 17:23:48 · 294 阅读 · 0 评论 -
There is no getter for property named 'itemsCustome' in 'class cn.itcast.ssm.po.ItemsVo'
There is no getter for property named 'itemsCustome' in 'class cn.itcast.ssm.po.ItemsVo'在mapper的xml文件中检查传参的问题Invalid property 'itemsCustom' of bean class [cn.itcast.ssm.po.ItemsVo]此错误可能原因:在mapper的x...原创 2019-02-20 17:19:46 · 419 阅读 · 0 评论 -
前台提交form,tomcat返回 http status 400 The request sent by the client was syntactically incorrect
前台提交form,tomcat返回 http status 400 The request sent by the client was syntactically incorrect,控制台无任何错误输出,使用的ide是idea;这是因为前台form表单中的某些参数 和 后台接受的参数类型不一致导致的。即参数名称相同,但是类型不一致。spring mvc在绑定参数的时候出现异常,所以返回...原创 2019-02-20 17:18:19 · 361 阅读 · 0 评论 -
关于HTTP Status 500 - Servlet.init() for servlet springmvc threw exception
初始化spring环境的异常 Error creating bean with name 'itemsController': Unsatisfied dependency expressed through field 'itemService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitio...原创 2019-02-20 17:15:52 · 1163 阅读 · 0 评论 -
关于gradle build 失败,提示jar包冲突解决方法
报的错误是这样的:Found interface org.objectweb.asm.MethodVisitor. But class was expected.简而言之,就是这包冲突了。我的是springboot的项目,但是经常卡在gradle build error 这一步,当时在网上查询了很多的方法,依然解决不了,改了中央仓库,为了不下jar包超时,且换了多个版本的gradle,也有...原创 2019-01-13 17:25:10 · 1399 阅读 · 0 评论 -
关于:OPTION SQL_SELECT_LIMIT=DEFAULT
我的是:jdk1.8.040 和connector5.1.38、mysqlserver5.1.12 下报You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OPTION SQL_...原创 2019-01-11 23:51:06 · 1101 阅读 · 0 评论 -
对于 BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the...
对于 报 "BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext" 的错误时,经过查阅和总结,得出如下的解决方案:1、查看是否导入mybatis-spring和mybatis的jar包。2、使用idea搭建maven-s...原创 2018-12-06 19:19:56 · 600 阅读 · 0 评论 -
学习ssm之后的个人对于找错的小总结
1.改错误之前,优先匹配jdk版本或者sql数据库版本(可能会出现找不到spingmvc.xml可以检查servlet里的classpath是否是springmvc)2.当遇到缺少适配器解析controller报错的时候,可以用检查springmvc.xml上配置的是否是SimpleControllerHandlerAdapter,之后重新实现controller接口....原创 2018-12-06 19:04:54 · 301 阅读 · 0 评论