随笔分类 - Spring
摘要:表单 <form class="form-horizontal" method="post" id="app"> <div class="card-body"> <div class="form-group row"> <label for="inputEmail3" class="col-sm-2
阅读全文
摘要:1.form表单,包括其他字段 <form class="form-horizontal" enctype="multipart/form-data" > <div class="card-body" > <div class="form-group row"> <label for="inputE
阅读全文
摘要:只需要在spring boot启动类上加上注解,并指定jar包中接口文件包路径即可 @MapperScan(basePackages = "com.xx.**.dao") 如果使用@Controller和@EnableAutoConfiguration 注解还应该再加上一个注解:@Component
阅读全文
摘要:1.打开cmd 2.cd到jar包目录 3.cmd 输入 java -jar name.jar
阅读全文
摘要:登录管理 @Override protected void configure(HttpSecurity http) throws Exception { http.authorizeRequests().antMatchers("/login").permitAll()// 这些资源放行 只放行登
阅读全文
摘要:控制器类 /** * 这是一个控制器类,相当于Servlet * @author wsh * */ @Controller //表示这是控制器类 public class PhoneController { @Autowired private PhoneRepository phoneServic
阅读全文
摘要:1.引入CSS <link rel="stylesheet" th:href="@{/css的相对路径.css}"> 2.引入JS <script th:src="@{/js的相对路径.js}"></script> 3.放行资源文件 @Override public void init(WebSec
阅读全文
摘要:Override 表示重写 HttpSecurity HTTP安全 authorizeRequests 授权请求 authorize formLogin 代表"http" antMatchers 匹配URL .permitAll()全部允许,允许没权限的人访问 .antMatchers("user/
阅读全文
摘要:@ResponseBody 表示返回的是josn
阅读全文
摘要:public interface UserRepository extends JpaRepository<User, Long> { //按表查询 @Query(value = "SELECT * FROM USERS WHERE EMAIL_ADDRESS = ?1", nativeQuery
阅读全文
摘要:把注解写在接口里面 public interface UserRepository extends JpaRepository<User, Long> { @Query("select u from User u where u.emailAddress = ?1") User findByEmai
阅读全文
摘要:利用InputStream.available()方法判断
阅读全文
摘要:1.建立工程 2.添加依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-aop</artifactId> </dependency> 3.建立一个普通的Spring
阅读全文
摘要:原因没有注入依赖,没有扫描到下面这个类
阅读全文
摘要:Pageable pageable = PageRequest.of(2,2); //第一个2表示从第几页开始,第二个2表示显示几条 Page<User> pages= userDao.findAll(pageable); model.addAttribute("users",pages); ret
阅读全文
摘要:1 在model层添加验证规则 2. 在model层添加验证规则
阅读全文