uuid类使用(生成随机字符串)
package com.itheima;
import java.util.UUID;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
String string = UUID.randomUUID().toString();
System.out.println(string);
string = string.replace("-", ""); // 去掉横线
System.out.println(string);
}
}
执行结果:
dd5f5f93-053e-4d13-933a-af437710a03f
dd5f5f93053e4d13933aaf437710a03f
Process finished with exit code 0
springboot页面文件放置位置
静态页面的return默认是跳转到/static/目录下,当在pom.xml中引入了thymeleaf组件,动态跳转会覆盖默认的静态跳转,默认就会跳转到/templates/下,注意看两者return代码也有区别,动态没有html后缀。