上一页 1 ··· 162 163 164 165 166 167 168 169 170 ··· 477 下一页
摘要: Fibonacci sequence: The most well-known approach is memoization. Advantage is fast, but space complexity is big. O(N). Bottom-up: 1 : Bottom-up dynami 阅读全文
posted @ 2021-01-18 03:35 Zhentiw 阅读(158) 评论(0) 推荐(0)
摘要: Why need to use @ResponseEntity, first let's see what problem we might have when we don't use it. @RestController public class ProductsRestController 阅读全文
posted @ 2021-01-15 21:38 Zhentiw 阅读(114) 评论(0) 推荐(0)
摘要: Interceptor jump in before controller. So request may not reach controller if Pre-process is not ok. Demo: package com.test.hplus.interceptors; import 阅读全文
posted @ 2021-01-15 19:56 Zhentiw 阅读(116) 评论(0) 推荐(0)
摘要: In this lesson, you will learn how to extend a class's functionality through typescript decorators. Decorators provide a way to add both annotations a 阅读全文
posted @ 2021-01-14 04:21 Zhentiw 阅读(77) 评论(0) 推荐(0)
摘要: @ControllerAdvice public class DefaultAttributeController { // apply default value @ModelAttribute("newuser") public User getDefaultUser() { return ne 阅读全文
posted @ 2021-01-13 19:40 Zhentiw 阅读(146) 评论(0) 推荐(0)
摘要: Create file: // this apply to all the controllers @ControllerAdvice public class ApplicationExceptionHandler { @ExceptionHandler(ApplicationException. 阅读全文
posted @ 2021-01-13 19:36 Zhentiw 阅读(106) 评论(0) 推荐(0)
摘要: Controller: @Controller public class LoginController { private UserRepository userRepository; @PostMapping("/login") public String login(@ModelAttribu 阅读全文
posted @ 2021-01-13 01:18 Zhentiw 阅读(83) 评论(0) 推荐(0)
摘要: If you need to convert a deep nested object struture, you cannot just use @InitBinder, you need to build a custom convertor: Exp: conver city prop in 阅读全文
posted @ 2021-01-13 00:54 Zhentiw 阅读(139) 评论(0) 推荐(0)
摘要: For example, from the client, it send date as string to BE. But BE requires date to be a Date instead of String. Controller: .. @Autowired private Use 阅读全文
posted @ 2021-01-13 00:39 Zhentiw 阅读(111) 评论(0) 推荐(0)
摘要: User entity: import javax.validation.constraints.*; @Entity public class User { @Id private int id; @Size(min = 6, message = "Username cannot be less 阅读全文
posted @ 2021-01-12 20:54 Zhentiw 阅读(101) 评论(0) 推荐(0)
上一页 1 ··· 162 163 164 165 166 167 168 169 170 ··· 477 下一页