![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java
xiaoqidela
见贤思齐
展开
-
java相对路径读取文件
java读取文件的相对路径问题转载 2017-06-18 23:44:22 · 519 阅读 · 0 评论 -
在spring Controller中返回自定义的Http code
怎么在Spring Controller里面返回404 SEP 27TH, 2014 6:02 PM 由于大多的客户端和服务端是独立的(可能用不同语言编写),客户端无法获知服务端的异常,所以普通的异常处理并不足以提示客户端。而基于HTTP协议的服务,我们则需要按照服务端的异常而返回特定的状态码给客户端。 以返回404状态码为例,在Spring 的Controller里面我转载 2018-01-05 12:24:16 · 6758 阅读 · 0 评论 -
jdbcTemplate得到自增的ID
import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.Statement; import org.springframework.jdbc.support.GeneratedKeyHolder; import org.springfr原创 2018-01-26 20:02:07 · 668 阅读 · 0 评论 -
java issue
使用logger.error(‘xxx’,e)的方式代替e.printStackTrace()记录错误日志原创 2018-06-29 15:52:04 · 557 阅读 · 0 评论 -
java下常用工具类
时间工具类 使用apache的commons包中的DateFormatUtils和FastDataFormat md5加密 使用apache的commons包的DigestUtils.md5Hex(String data)方法原创 2018-06-10 18:11:28 · 121 阅读 · 0 评论 -
项目中遇到的问题
1.Raltime2MonitorController中实现PageService接口,访问报错(PageService在epoch-common-service-3.0.2-20150118.050456-1.jar中) 此时新建com.fpi.prd.APageService2接口,将PageService接口内容复制到APageService2中,Raltime2MonitorCont...原创 2018-07-10 20:49:19 · 550 阅读 · 0 评论 -
数据库常用语句
mysql按ip查看连接数 SELECT SUBSTRING_INDEX(HOST, ‘:’, 1) AS ip,count(*) FROM information_schema. PROCESSLIST GROUP BY ip;转载 2018-12-19 09:58:05 · 200 阅读 · 0 评论