- 博客(80)
- 收藏
- 关注
转载 用stream流初始化集合类
原文链接https://blog.youkuaiyun.com/fsdgrasdfg/article/details/110677369/** * 流的终结操作,可以将流转化为list,set,map等 */ @Test public void testCollect() { List<OrderItem> orderItemsList = IntStream.rangeClosed(1, 10).mapToObj(i -> new OrderItem(Long.p.
2021-12-03 11:33:49
336
原创 Error resolving template [/include/include], template might not exist or might not be accessible by
thymeleaf路径问题,检查下配置文件里prefix和html里写的路径这里的templates后有一个斜杠了,那么第一个include前面就不需要斜杠了
2021-07-15 08:44:02
958
转载 注册中心服务已经注册成功但是无法连接
原文链接原文链接原文链接SpringCloud向eureka服务注册中心时候,如果不指定IP,设定的IP地址可能是局域网IP,如果client之间网段不通,会无法进行通信。SpringCloud注册时候使用指定的IP注册:eureka: instance: prefer-ip-address: true ip-address: 10.33.133.133...
2021-07-15 08:37:03
1626
转载 maven 打包提示程序包xxx不存在?
依赖自己写的一个common包里面的类,可是common包明明已经install了,库里也有包了,为什么引用他的项目在打包时提示classnotfound呢。原文链接原文链接原文链接你的A模块是一个spring boot项目,创建生成的pom的中肯定是这样的build的<build> <plugins> <plugin> <groupId>org.springframework.boot</gro
2021-07-14 16:10:30
1454
1
原创 redistempalte.opsforvalue().set存入数据乱码
这是由于set(K key, V value, long timeout, TimeUnit unit),这里的timeout单位为long,所以修改后应该是
2021-07-09 16:02:10
1342
原创 idea中project和module与eclipse中workspace和project
简单的概括如下:IntelliJ系中的 Project 相当于Eclipse系中的 Workspace ;IntelliJ系中的 Module 相当于Eclipse系中的 Project ;IntelliJ中一个 Project 可以包括多个 Module ;Eclipse中一个 Workspace 可以包括多个 Project;...
2021-06-23 14:27:16
476
转载 A granted authority textual representation is required
原文链接原文链接原文链接原因是SimpleGrantedAuthority的构造方法Assert.hasText(String text) / hasText(String text, String message)text (权限名)不能为 null 且必须至少包含一个非空格的字符,否则抛出异常;
2021-06-08 20:43:05
694
1
转载 java.lang.ClassNotFoundException: javax.servlet.Filter
原文地址原文地址原文地址1.在maven中的作用域,不能是provided,需要是compile就是默认的scope2.spring-boot-starter-tomcat的版本bug,换个新的或旧的版本试试
2021-06-07 21:53:05
475
转载 MySQL忘记root密码
原文链接原文链接原文链接1.使用管理员权限打开命令提示符,在命令行中输入: net stop mysql2.待mysql服务停止后,输入: mysqld --shared-memory --skip-grant-tables ,此时命令提示符窗口处于锁定状态,我们重新以管理员权限打开新的命令提示符窗口。3.在新的命令提示符窗口输入: mysql -uroot -p 后回车,提示输入密码时直接按回车进入。4.输入: use mysql;5.输入: update user set authenti
2021-06-03 16:59:12
6950
原创 sidebar侧栏菜单选择标签地址变为相对路径
<c:forEach items="${parent.children}" var="child"> <li style="height:30px;"> <a href="${child.url}"><i class="${child.icon}"></i> ${child.name}</a> ..
2020-12-02 01:19:10
379
原创 写的分页只显示上一页和下一页,中间页码不显示
<c:forEach items="${page.navigatepageNums}" var="num"><c:if test="${num} == ${page.pageNum}"> <li class="active"><a href="${PATH}/admin/index?pageNum=${num}">${num}<span class="sr-only">(current)</span></a><
2020-11-25 02:32:25
495
原创 Don‘t know how to iterate over supplied “items“ in <;forEach>;
在JSP文件中,JSTL的标签 <c:forEach> 里的items属性被赋予了一个无法遍历的对象问题再现:用的代码提示没仔细看<c:forEach items="${page.navigatepages}" var="num">应该是page.navigatepageNums
2020-11-25 02:14:17
645
原创 maven下web项目使用jcl-over-slf4j后报错ClassNotFoundException: org.apache.commons.logging.Log
解决方案:在IDEA中点击File > Project Structure > Artifacts > 在右侧Output Layout右击项目名,选择Put into Output Root,顺便remove掉红色的commons-logging的jar包,然后重启tomcat
2020-11-18 08:37:44
674
转载 maven+SSM开发java.lang.ClassNotFoundException:org.springframework.web.context.ContextLoaderListener报错
原文解决方案:在IDEA中点击File > Project Structure > Artifacts > 在右侧Output Layout右击项目名,选择Put into Output Root之后重启tomcat
2020-11-16 15:57:23
162
转载 Maven报错:The packaging for this project did not assign a file to the build artifact
原文解决方案:使用Maven管理工具下的LifeCycle(生命周期)中的install
2020-11-16 14:45:22
628
原创 The packaging for this project did not assign a file to the build artifact,No plugin found for prefi
问题简述:pom.xml配置文件里面声明了plugin,但是install后没有看到,报错问题还原:一开始使用idea的mybatis-generator插件逆向生成时报错:No plugin found for prefix ‘mybatis-generator’ in the current然后看网上教程先clean再install,接着报错:The packaging for this project did not assign a file to the build artifact
2020-11-06 01:07:27
630
转载 ideamaven中web项目中web.xml中的classpath指项目中的哪个路径
引用解答classpath对应的路径其实就是项目中的src文件中。后面测试:如果你将config文件放在src->main下也是可以被找到的,放在src->main->source也是可以
2020-11-05 20:14:45
527
转载 关于Idea中右边的maven projects窗口找不到了如何调出来
由于将maven项目copy到了另外的工作空间,没有识别出来,想通过自带的maven插件重新添加,但没找到。解决方法
2020-11-05 01:12:17
727
原创 HiddenHttpMethodFilter报错405不起作用,将url从/改为/*后生效
在网上看到的关于url的信息:关于web.xml的url映射的小知识:/ 会匹配到/login这样的路径型url,不会匹配到模式为.jsp这样的后缀型url/* 会匹配所有url:路径型的和后缀型的url(包括/login,.jsp,.js和*.html等)(有星号)但我的请求路径第一种/的情况就应该可以满足才对,不知道为啥要第二种才生效,先放着把...
2020-11-04 17:09:18
561
原创 .MySQLSyntaxErrorException: Unknown column ‘e.name‘ in ‘field list‘
根据报错的具体提示找到sql语句检查发现写错了,应该是e.ename
2020-11-04 01:11:58
1832
转载 org.xml.sax.SAXParseException; lineNumber: 10; columnNumber: 60; cvc-complex-type.2.4.c:通配符的匹配很全面, 但
原因:Spring命名空间配置错误,缺少相应的spring-bean。
2020-11-03 14:56:53
1047
转载 0x0FA23F7D (ucrtbased.dll)处(位于.exe 中)引发的异常: 0xC0000005: 读取位置 0x0000012C 时发生访问冲突。
@语冰咔咔 楼下评论解决的
2020-11-03 12:40:30
7419
原创 The matching wildcard is strict, but no declaration can be found for element ‘tx:annotation‘
idea在spring.xml的命名空间自动导入xmlns:tx=“http://www.springframework.org/schema/tool”时url 没有配置好,最后的tool改成tx就好了
2020-11-03 00:44:37
384
转载 junit 单元测试报错:java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing
原文链接所以现在有两个办法解决:1.junit版本降到4.102.导入hamcrest-core-1.3.jar
2020-10-27 20:14:41
185
转载 Resources Root目录和Sources Root目录的区别
Sources RootBy assigning a folder to this category, you tell IntelliJ IDEA that this folder and its subfolders contain source code that should be compiled as part of the build process.通过将文件夹加入这种类别,来告诉IntelliJ IDEA,这个文件夹和它的子文件夹中包含源码,在构建工程时,需要作为一部分被编译进去。R
2020-10-27 01:19:56
7041
3
转载 关于在 IntellIj IDEA中JSP页面 cannot resolve method getParameter(““)的解决方案
解决方案servlet.jar和servlet-api.jar包导入
2020-10-18 12:37:39
530
转载 jdbc:mysql:/// jdbc连接数据url简写方式
正常情况下我们写jdbc连接本地mysql数据库的时候通常是这样写jdbc:mysql:localhost:3306/数据库名下面就是要提到的简单的方法jdbc:mysql:///数据库名
2020-10-14 13:38:21
578
转载 idea打开jsp浏览器地址显示file:///D:xxxxxxxxx,无法显示正常页面
退出浏览器,清除浏览器缓存,再重新部署即可8楼@SKYbiubiu的解答
2020-10-13 17:09:50
1129
转载 Cannot resolve symbol ‘HttpSession‘ ‘HttpServletRequest‘
网上搜到的解决方案6楼 @VitoYi : 问题在于servlet-api.jar,tomcat中自带这个jar包,所以在Eclipse中从来没配置过,但是没想到idea上要手动将此jar包引入工程。
2020-10-13 15:25:36
1393
原创 mybatis中#{}和${}的区别,关联JDBC:Statement和Preparement
mybatis中#{}和${}的区别其中关于Preparement下面链接有解释JDBC基础(二):Statement和Preparement批量删除和模糊查询只能使用statement拼接查询
2020-10-12 23:26:06
208
原创 IDEA pom.xml里面添加依赖,但项目里没有jar包
在pom.xml里面添加依赖后,项目导入的jar包只有jdk的解决方法:右键项目–>>Maven–>>Reload Project
2020-10-09 23:20:15
3047
原创 路径报错,在模块中搜索路径名找不到
事情很有趣,课设找到个很简洁的轮子,fork下来运行发现报错,如下[ERROR] User File has not exist!java.io.FileNotFoundException: F:\Android\Work\user.txt (系统找不到指定的路径。)然后在模块里直接搜F:\Android\Work\user.txt发现没结果,后来去文件里慢慢找,结果发现了这个private final String USERLIST_FILE = "F:\\Android\\Work\\
2020-07-02 11:35:33
425
转载 java 反射机制之 getDeclaredMethod()获取方法,然后invoke执行实例对应的方法
原地址使用场景: 大量if-else判断,用反射优化
2020-06-18 15:10:34
404
原创 mysql在查询时丢失数据库127.0.0.1连接
问题还原:我的windows装的tomcat发现连接不到数据库,昨天还用的好好地今天为啥就不行了呢,想到昨天用虚拟机运行了Apache,会不会是这个导致的呢解决方案重启下windows服务里的mysql就可以了
2020-06-17 11:31:17
914
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人