![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
Config
文件配置
hvk_l
精致的沉默,凌驾于一切之上。
展开
-
序列化和反序列化对象的工具类
public class SerializeUtil { public static byte[] serialize(Object object) { ObjectOutputStream oos = null; ByteArrayOutputStream baos = null; try { // 序列化 baos = new ByteArrayOutputStream(); o原创 2021-06-19 13:36:11 · 204 阅读 · 0 评论 -
反射之修改配置文件读取调用
全类名 com.Student //加载数据 Properties prop new Properties(); FileReader fr = new FileReader( fileName: "module\\class.txt"); prop.load(fr); fr.close();/* className=com.Student methodName=study*/ String className = prop.getProperty("className"); Str原创 2021-03-27 11:26:49 · 85 阅读 · 0 评论 -
springboot的pom.xml配置
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">原创 2021-03-26 11:07:25 · 103 阅读 · 0 评论 -
maven
maven的命令格式如下: mvn [plugin-name] :[goal-name] 命令代表的含义:执行plugin-name插件的goal-name目标1.常用命令命令描述mvn -version显示版本信息mvn clean清理项目生产的临时文件,一般是模块下的target目原创 2021-03-23 23:44:44 · 74 阅读 · 1 评论 -
jdbc配置文件
判断数据库连接public static void main(String[] args) { try { Connection conn = JdbcUtils.getConnection(); System.out.println("数据库连接成功"); } catch (SQLException throwables) { throwables.printStackTrace(); System.out.println(原创 2021-03-16 21:47:09 · 106 阅读 · 0 评论 -
Serializable序列化
一个类只有实现了Serializable接口,它的对象才是可序列化的。该接口没有需要实现的方法,implements Serializable只是为了标注该对象是可被序列化的。实现serializable接口的作用是就是可以把对象存到字节流,然后可以恢复。所以你想如果你的对象没实现序列化怎么才能进行网络传输呢,要网络传输就得转为字节流,所以在分布式应用中,你就得实现序列化。...原创 2021-04-17 15:03:49 · 55 阅读 · 0 评论 -
yaml配置细节
加载指定的配置文件@PropertySource :加载指定的配置文件@PropertySource(value = "classpath:person.properties")@Component //注册beanpublic class Person { @Value("${name}") private String name; ...... }@configurationProperties:默认从全局配置文件中获取值@ConfigurationProp原创 2021-05-13 22:11:32 · 91 阅读 · 0 评论 -
RESTful操作资源
传统方式操作资源 :通过不同的参数来实现不同的效果!方法单一,post 和 gethttp://127.0.0.1/item/queryItem.action?id=1 查询,GEThttp://127.0.0.1/item/saveItem.action 新增,POSThttp://127.0.0.1/item/updateItem.action 更新,POSThttp://127.0.0.1/item/deleteItem.action?id=1 删除,GET或POST使用RESTf原创 2021-05-02 05:14:07 · 303 阅读 · 0 评论