最近SpringBoot项目遇到的各种问题汇总

项目中Mybatis问题

SpringBoot中集成Mybatis 报错
Parameter ‘ccConttype’ not found. Available parameters are [arg1, arg0, param1, param2]

//Mapper.class 中的写法
Long selectCountContractStatus( String ccConttype , String ccContstatus);

//Mapper.xml中的写法
 <when test="ccConttype != null and ccConttype != '' ">
          AND  cc_conttype = #{arg0}
        </when >
        <when test="ccContstatus !=null and ccContstatus != ''  ">
          AND  cc_contstatus = #{arg1}
        </when >

解决方法

// An highlighted block
Long selectCountContractStatus(@Param("ccConttype") String ccConttype , @Param("ccConttype")String ccContstatus);


//Mapper.xml中的写法
 ** <when test="ccConttype != null and ccConttype != '' ">
          AND  cc_conttype = #{ccConttype}
        </when >
        <when test="ccContstatus !=null and ccContstatus != ''  ">
          AND  cc_contstatus = #{ccContstatus}
        </when >

##Redis问题

报错:ERR Client sent AUTH, but no password is set
问题是SpringBoot Redis配置文件中使用了Redis的密码
而在Redis相关用户配置中并不存在密码

/**Redis Cli**/
127.0.0.1:6379> auth 123
(error) ERR Client sent AUTH, but no password is set
127.0.0.1:6379> auth root
(error) ERR Client sent AUTH, but no password is set
127.0.0.1:6379> CONFIG SET requirepass "123"
OK
127.0.0.1:6379>

或者是直接在项目的Redis配置文件中将密码设置为空

redis-pool.password=

##在JSP页面中如何使得JS取得Model传入的attribute
在网上找了很多相应的方法,都试过来了
只是其中找的一个,其实方法应该是能用的,可能是我的使用方法错了吧

https://www.cnblogs.com/wwct/p/12143084.html

最后偶然发现了最简单的

  		var ccConttype = "${contract.ccConttype}";
        var ccContstatus = "${contract.ccContstatus}";
        var ccRealysub = "${contract.ccRealysub}";

直接使用JavaScript进行赋值

###使用 target=‘mainFrame’ 进行框架中的页面跳转

出现问题,点击其中一个页面链接之后,所有的页面全部都变成新页面,不能直接更换框架内页。
查了三天,终于发现,在该页面中定义了全局的name

  		var name =...

该name导致target中的name失效。所有页面变成了新窗口打开

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值