随笔分类 -  Java

摘要:@RestResource(exported = false): makes the endpoint no longer visible for public. package com.example.ec.repo; import com.example.ec.domain.TourPackag 阅读全文
posted @ 2020-12-14 04:16 Zhentiw 阅读(75) 评论(0) 推荐(0) 编辑
摘要:package com.example.ec.repo; import com.example.ec.domain.Difficulty; import com.example.ec.domain.Region; import com.example.ec.domain.Tour; import o 阅读全文
posted @ 2020-12-14 03:51 Zhentiw 阅读(60) 评论(0) 推荐(0) 编辑
摘要:Entity: package com.example.ec.domain; import javax.persistence.*; @Entity public class Tour { @Id @GeneratedValue private Integer id; @Column private 阅读全文
posted @ 2020-12-12 22:01 Zhentiw 阅读(126) 评论(0) 推荐(0) 编辑
摘要:Create you own decreator! Add dependency: <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>1.9.5</version> 阅读全文
posted @ 2020-12-09 03:35 Zhentiw 阅读(170) 评论(0) 推荐(0) 编辑
摘要:Besides using Profiles, we can also us Spring Expression Language. package com.frankmoley.lil.fid.config; import com.frankmoley.lil.fid.service.Greeti 阅读全文
posted @ 2020-12-04 22:23 Zhentiw 阅读(85) 评论(0) 推荐(0) 编辑
摘要:For example, inside code, we want production env & dev env print different time format. @Bean @Profile("!dev") public TimeService timeService(){ retur 阅读全文
posted @ 2020-12-04 16:01 Zhentiw 阅读(84) 评论(0) 推荐(0) 编辑
摘要:We can have some properties defined inside application.properties or application.yml file. application.properties: app.name=Frank app.greeting=Hello W 阅读全文
posted @ 2020-12-04 15:50 Zhentiw 阅读(100) 评论(0) 推荐(0) 编辑
摘要:pom.xml: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency> SecurityConfigur 阅读全文
posted @ 2020-12-01 15:41 Zhentiw 阅读(82) 评论(0) 推荐(0) 编辑
摘要:pom.xml: <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </dependency> <dependenc 阅读全文
posted @ 2020-11-30 22:36 Zhentiw 阅读(110) 评论(0) 推荐(0) 编辑
摘要:Run bash to generate keystore.jks in src/mian/resources folder: keytool -genKey -keyalg RSA -alias linkedin -keystore keystore.jks -storepass password 阅读全文
posted @ 2020-11-30 03:50 Zhentiw 阅读(70) 评论(0) 推荐(0) 编辑
摘要:Profiles allow us to do different configurations based on different env. application.yml: spring: profiles: dev server: port: 8000 spring: profiles: t 阅读全文
posted @ 2020-11-30 03:29 Zhentiw 阅读(102) 评论(0) 推荐(0) 编辑
摘要:We can use @Controller to return a view with data: package com.frankmoley.lil.learningspring.web; import com.frankmoley.lil.learningspring.busniess.do 阅读全文
posted @ 2020-11-29 03:42 Zhentiw 阅读(94) 评论(0) 推荐(0) 编辑
摘要:Controller: @Controller @RequestMapping("/reservations") public class RoomReservationWebController { @Autowired private ReservationService reservation 阅读全文
posted @ 2020-11-29 02:41 Zhentiw 阅读(128) 评论(0) 推荐(0) 编辑
摘要:First, let's see the code: // builder/Contact.java public class Contact { private String firstName; private String lastName; private String emailAddre 阅读全文
posted @ 2020-11-13 15:43 Zhentiw 阅读(89) 评论(0) 推荐(0) 编辑
摘要:Coding again the interface. interface: package com.frankmoley.lil.designpatternsapp.factory; public interface Pet { void setName(String name); String 阅读全文
posted @ 2020-11-11 17:38 Zhentiw 阅读(124) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。
posted @ 2019-07-27 03:26 Zhentiw 阅读(4) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。
posted @ 2019-07-19 02:14 Zhentiw 阅读(2) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。
posted @ 2019-06-27 03:16 Zhentiw 阅读(1) 评论(0) 推荐(0) 编辑
摘要:Previouly we need to define a DAO interface and a DAO impl for 'Employee', it is not so reuseable, since all the DAO has the same structure: Spring da 阅读全文
posted @ 2019-06-24 13:43 Zhentiw 阅读(160) 评论(0) 推荐(0) 编辑
摘要:pom.xml: The process can be divide into 6 steps: 1. Update db configs in application.properties 2. Create Employee entity 3. Create DAO interface 4. C 阅读全文
posted @ 2019-06-16 16:27 Zhentiw 阅读(498) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示