问题解决之路
pink_soda
不知道还能再当多久的程序媛~
展开
-
【pycharm远程连接服务器 控制台输出中文乱码问题 解决】
修改远程服务器编码为UTF-8修改本地服务器编码为UTF-8IDE设置工程编码等为UTF-8设置本地环境变量修改pycharm64.exe.vmoptions文件, 添加一行:-Dfile.encoding=UTF-8单个文件修改默认编码为utf-8在文件的最顶部添加代码:#!/usr/bin/env python# -*- encoding: utf-8 -*-...原创 2022-02-25 16:04:27 · 1844 阅读 · 1 评论 -
thymeleaf 使用图片url或者上传本地图片
配置文件:# 声明图片的绝对路径和相对路径file.upload.path=F://images/file.upload.path.relative=/images/**配置类:import org.springframework.beans.factory.annotation.Value;import org.springframework.context.annotation....原创 2020-03-15 20:33:21 · 6342 阅读 · 0 评论 -
thymeleaf实现表格中序号的自增
在后端数据库在前端用表格展示时,为了更清楚地知道当前有多少条数据,需要在每一行前方都加上自增的序号。th:each循环迭代语法:th:each="obj,itemStat:${objList}itemStat称作状态变量,属性有:index:当前迭代对象的index(从0开始计算)count: 当前迭代对象的index(从1开始计算)size:被迭代对象的大小current:当前迭...原创 2020-03-15 15:25:11 · 2948 阅读 · 2 评论 -
mysql后台datetime数据,前端输出只有分钟不对--解决
对应实体类:package com.ckh.springboot04.entities;import lombok.Data;import org.springframework.data.annotation.CreatedDate;import org.springframework.data.annotation.LastModifiedDate;import org.sprin...原创 2020-03-14 19:08:15 · 341 阅读 · 0 评论 -
Spring boot重定向与转发的区别
重定向就是浏览器重新发送新的请求,请求域改变,浏览器上的地址栏有变动,发送的地址是相对于项目的地址;转发就是服务器在服务器内部进行请求的转发,请求域不变,浏览器上的地址栏不变;一般在处理一个请求后再跳转到另一个处理请求时,进行重定向redirect;当请求不能变时,用forward转发请求。更详细的解释...原创 2020-03-11 21:22:57 · 1238 阅读 · 0 评论 -
四种请求方式get、post、put、delete的区别
POST /uri 创建 DELETE /uri/xxx 删除 PUT /uri/xxx 更新或创建 GET /uri/xxx 查看 具体详细解释请看这篇博文原创 2020-03-11 21:14:25 · 1284 阅读 · 0 评论 -
Spring Boot 报错:This application has no explicit mapping for /error
写了一个配置类,扩展Spring MVC:package com.ckh.springboot04.config;import org.springframework.context.annotation.Configuration;import org.springframework.web.servlet.config.annotation.ViewControllerRegistry...原创 2020-03-09 20:54:45 · 431 阅读 · 0 评论 -
Web server failed to start. Port 8082 was already in use.
端口8082被占用了。原因可能如下:1电脑中其他进程占用8080端口;2其他Spring Boot项目占用8080端口;3自己要运行的项目重复生成占用了端口。解决方法:打开cmd,输入如下命令,查找8082端口对应的进程ID PID:netstat -ano这里PID为10400,再输入如下命令杀死进程:taskkill /F /pid 10400重启项目,成功运行。参...原创 2020-03-09 13:45:14 · 5627 阅读 · 2 评论 -
Spring Boot项目 配置文件读取顺序问题
spring boot 打成jar包后,只会读取到src以下的内容,也就是类路径下的配置文件有效,原来项目根目录下的配置文件并没有在jar包中。但是,如果spring boot没有打包过,那么根目录下的配置文件生效。配置文件顺序如下:...原创 2020-03-09 13:35:49 · 290 阅读 · 0 评论 -
@PropertySource 读不到配置文件的属性值
原来Person类这样写: 只写了@PropertySource注解@Component@PropertySource(value = {"classpath:person.properties"})public class Person { private String lastName; private int age; private boolean ...原创 2020-03-08 11:59:27 · 5737 阅读 · 0 评论