springboot(4)
-
thymeleaf, external_img
thymeleaf2__JPA_H2 package com.example.demo.controller; @Controller public class MainController { // 자동 index.html 부터 시작 주소는 / @Autowired UserService service; @RequestMapping("/join") //회원가입 폼 public String join(){ System.out.println("/join"); return "joinForm"; } @RequestMapping("/register") //회원가입 public String register(User user){ System.out.println("/register "+ user); service.save(user);//d..
2024.03.12 -
redirect,thymeleaf
thymeleaf main Main.html main2 Main2.html main3 main3.html main4 main4.html main5.html 홍길동/20 이순신 홍길동/20 세종/40 세종/40 main5_1.html main6 main6.html 1. 문자열 리터럴 template file 2. 숫자 리터럴 this year is 1111. In two years, it will be 1111. 3. 불린 리터럴: 태그의 사용 여부 결정 이름은 홍길동 (thymeleaf 가 처리) 이름은 홍길동 (springEL 가 처리) 이름은 aaa 아님 null 문자 사용 가능 null 문자 사용 가능 4. null 리터럴 null 문자 사용 가능1 null 문자 사용 가능2 5. 텍스트 추가 및 ..
2024.03.12 -
list, map, @Autowired
collection_list @SpringBootApplication /// 서브패키지에 있는 @JavaConfig 자동생성함 public class Sample01BeanApplication { public static void main(String[] args) { ApplicationContext ctx=SpringApplication.run(Sample01BeanApplication.class, args); DBService service= ctx.getBean("myService", DBService.class); List list= service.list(); System.out.println(list.size()); for (String s : list) { //List data= dao.l..
2024.02.28 -
springboot
springProfile application.properties 설정값에 따라 log 가 다르게 나옴 spring.profiles.active=prod #spring-profiles.active=dev banner public static void main(String[] args) { //SpringApplication.run(Boot03Banner01NobannerApplication.class, args); SpringApplication app = new SpringApplication(Boot03Banner01NobannerApplication.class); app.setBannerMode(Banner.Mode.OFF); //배너 끄기 app.run(args);//boot app 실행 } 한글..
2024.02.28