- 博客(11)
- 收藏
- 关注
原创 springboot 多topic 动态配置
项目中需要能够动态配置topic进行消费。1.application.properties中配置topicName=topic1,topic22.@KafkaListener(topics = {"#{'${topicName}'.split(',')}"})3.pom文件引入springkafka-1.2.2,不能引入springkafka-1.1.0。原因如下:1.1.0中...
2019-08-12 14:51:43 2119
原创 linux命令
重启:rebootnginx:1.查看linux是否启动nginx:ps -A | grep nginx2.查看nginx启动得相关映射:ldd $(which /usr/local/nginx/nginx-1.14.2/sbin/nginx)如有nof found,可添加相关映射:ln -s /usr/lib64/libpcre.so.1.2.0 /usr/lib64/libpc...
2019-04-30 17:58:00 231
原创 java String 转map、list
import com.alibaba.fastjson.JSONObject;String转ListList<Map> datalist = JSONObject.parseArray(str, Map.class);String转mapMap<String, Object> eventMap = (Map<String, Object>)...
2019-04-29 22:08:57 5407
原创 NoClassDefFoundError: com/fasterxml/jackson/core/util/DefaultIndenter
原因是spring 4.x以上的版本与Jackson2.4.1的版本发生了冲突,改成2.6以上的就好了
2018-04-19 14:31:18 757
原创 JSP页面只显示源代码不显示网页内容
在web.xml中找到 <servlet-mapping> <servlet-name>dispatcher</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping>修改为 <servlet-mapping> <servle
2018-04-09 13:14:37 11112 4
原创 maven工程报错:One or more constraints have not been satisfied
在pom文件中加入下列语句: <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId>
2018-04-09 11:25:22 184
原创 mybatis当传入数据类型为Int时并且值为0时,会判断为空字符串
一般在mybatis中插入或者修改时,会将字段做非null和非空判断,如下所示:<if test="operatype_enum != null and operatype_enum != ''"> operatype_enum =#{operatype_enum},</if>这样写,当operatype_enum=0时,mybatis将不会插入改字段,因为mybatis...
2018-04-08 11:25:06 1830
原创 Spring AOP不进入before和业务方法,却进入其他切面的问题
由于业务需求,需要编写一个AOP用来记录一些外部接口的调用日志.首先是引入切面要用到的jar包,maven工程加入如下所示:然后是配置文件,由于要在controller层加上切面,因此需要在springMVC的配置文件上加上<aop:aspectj-autoproxy proxy-target-class="true" />如此,配置文件的修改就完成了.接下来就是编写切面类了,代码如下...
2018-03-12 15:36:33 8812 3
原创 Mybatis OGNL表达式报错
Malformed OGNL expression: JCKBH!= null and JCKLX=='0' 报错原因: 1.同一个if判断里,不能写两个key值;2.JCKLX=='0' 应该写成 JCKLX=='0'.toString(),否则程序不稳定因此:原代码<if test="JCKBH!= null and JCKLX=='0' ">应
2018-02-01 09:54:11 925
原创 Spring MVC ajax请求
首先在JSP中写一个Ajax请求 var basePath = ""; function test(){ //alert(1); alert(basePath+"/echarts/getEmpSalary"); $.post(basePath+"/echarts/getEmpSalary", {
2017-11-18 14:53:09 219
原创 Maven项目引入JS,css等文件的问题
今天在项目中引入JS,CSS文件遇到的问题,路径明明是对的,但就是没有效果,项目结构如下所示:查资料发现,需要做如下配置,首先在web.xml中进行拦截配置: default *.js default *.css
2017-11-18 13:19:47 4191
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人