随笔分类 - JAVA
SpringBoot 注解实体类中非数据库字段属性
摘要:刚学SpringBoot 就踩坑了,在实体中加了了个List集合已启动就报了一堆的错误 解决方法:在属性上或者get方法上添加添加 @Transient 表示它不是数据库字段
阅读全文
ajax请求controller出现中文乱码
摘要:ajax请求controller出现中文乱码 解决方法:在 @RequestMapping 中加上 produces = {"application/json;charset=UTF-8"}
阅读全文
在使用 Eclisp 生成 实体(sql Server) 出现错误 :Unable to locate JAR/zip in file system as specified by the driver definition: sqljdbc.jar.
摘要:错误: 解决方法: 第一步:点击 JAR List 第二步: 点击 Remove JAR/ZIP 第三步: 再添加一下 sqljdbc.jar
阅读全文
Eclipse 修改项目名称
摘要:太久没修改过项目名称了,结果现在需要修改的时候忘记怎么修改了,我也是醉了.....................................下面记录下,希望不要再忘记 第一步:项目 右击 properties 第二步:找到 Web Project Settings 修改 Context roo
阅读全文
错误: java.lang.reflect.InvocationTargetException
摘要:错误: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl
阅读全文
java 中Session 持久化问题
摘要:首先: 今天发现了个session 持久化的问题 在Tomcat 停止运行后再启动 session 中保存的东西还会存在 ,百度了一下 原理 1、Session Create 时 2、Session timeout 时 3、显式调用session的invalidate方法 时 4、在Tomcat设置
阅读全文
后台接收前台传入的json 数据
摘要:方法一: 引入JSONArray的类型为org.json而不是net.sf.json,笔者开始引入的是net.sf.json.JSONArray, 但JSONObject.fromObject(obj)时报错报java.lang.reflect.InvocationTargetException错误
阅读全文
java.lang.NumberFormatException: For input string: "1608020001 " 错误
摘要:错误: java.lang.NumberFormatException: For input string: "1608020001 " at java.lang.NumberFormatException.forInputString(Unknown Source) at java.lang.In
阅读全文
eclipse启动报错java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' befo
摘要:报错: java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: Root WebAp
阅读全文
java 获取系统当前时间
摘要:Calendar ca = Calendar.getInstance(); int year = ca.get(Calendar.YEAR);//获取年份 int month=ca.get(Calendar.MONTH);//获取月份 int day=ca.get(Calendar.DATE);//
阅读全文
mybaties 查询 语句正确 但是查不到结果
摘要:控制台输出的语句拿到数据库查询就有数据,但是一直显示不出来 也不报错 后来 百度发现数据库连接不对 因为其中引用了两个数据库 所有写混了 下面是百度出来的一些解决方法 解决方案1: 是不是在代码中的一些特殊字符问题,比如:将查询条件中的“#”替换成“$”. 解决方案2: 打个断点看看执行到了哪里 解
阅读全文