html1

Html
HyperText Markup Language
<html>
<head>
<title>标题</title>
</head>
<body>
</body>
</html>

基本标签
<div>、<span>、<img align src=“” />
选择器
element(标签选择器)、
class(利用空格应用多个class)、
包含、分组、hover
常用属性(CSS_2.0.chm)
text-align、font-size、color、background
margin、padding、width、height

<input type=“{ text | checkbox | radio }” value=“”/>
<select>、<option>、<button>、<label for>
<a href=“url”>、绝对路径、相对路径

<table border=“” width=“” height=“” align=“” >
<tr>
<td valign=“{ top | middle | bottom }” colspan rowspan>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
width、height、border、padding、margin
float、clear、display:none | block | inline
position:absolute | fixed | relative、 z-index

spring.main.banner-mode=off
logging.level.root=error
logging.level.com.yvdedu.test3=trace

server.port=8081

spring.resource.static-locations=classpath:/static

bootStrap
<p th:utext="${text}"></p>传过来的文本当标签显示
controller是直接返回到视图,不写则显示到默认视图
Model model model.addAttribute("名字") string
model.addAttribute("text","<button>传的按钮</button>");
@ResponseBody
edit/{name}
(@PathVariable("name") String name)
th:each="user:${userList}"
th:href="'/user/edit/'+${user.name}"
${user?.name}不报错
th:if="${user.name=='abc'}"
@RequestParam(defaultValue = "2") int id


Application方法上implements WebMvcConfigurer 接口
@Autowired
private TestInterceptor testInterceptor;
@Override
public void addInterceptors(InterceptorRegistry regidtry){
registry.addInterceptor(testInterceptor).addPathPatterns("/**").excludePathPatterns("/error","/login");

@Component
public class TestInterceptor implements HandlerInterceptor{
@Override
public boolean preHandle (HttpServletRequest request,HttpServletResponse response, Object handler) throws Exception .....{
if(handler instanceof ResourceHttpRequestHandler){
return true;}
return true;}
}

@NotNull@Size(min = 1,message="必须填写密码")
private String name;
@Validated User user,BindingResult result){
if(result.hasErrors(){
return ...(result.getFieldError().getDefaultMessage())}}

网页挖洞
<dependency>
<groupId>nz.net.ultraq.thymeleaf</groupId>
<artifactId>thymeleaf-layout-dialect</artifactId>
<version>2.0.5</version>
</dependency>
<title layout:title-pattern="$DECORATOR_TITLE - $CONTENT_TITLE"装饰页面标题-内容页面标题
xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
<html layout:decorator="layout"洞的填充内容页面,layout是挖洞页面的名字
<div layout:fragment="name"洞的位置,洞页面和挖洞页面都一样写

原文地址:https://www.cnblogs.com/xiao-c-s/p/12419707.html