코딩(59)
-
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 -
boot-database
h2 h2 DROP TABLE IF EXISTS USER; CREATE TABLE IF NOT EXISTS USER( ID NUMBER IDENTITY PRIMARY KEY, -- identity는 auto increment 값이다. NAME VARCHAR(50), ADDRESS VARCHAR(50) ); INSERT INTO USER(NAME, ADDRESS) VALUES('HONG', 'SEOUL'); INSERT INTO USER(NAME, ADDRESS) VALUES('KIM', 'BUSAN'); INSERT INTO USER(NAME, ADDRESS) VALUES('LEE', 'INCHEON'); drop table user; application.properties spring.datasour..
2024.03.11 -
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 -
myBatis2
controller => list 주소 처리 return void로 설정 service.list()함수 이용 전체 데이터 select 전체 데이터 sysout확인 후 model에 저장 list.jsp로 응답위임 list.jsp => el태그 이용 전체 테이터 출력 main.jsp 수정 추가 => db insert 후 list 다시 띄우기 (51번 사원추가 테스트 ) 2.삭제 => 51번 삭제 후 list다시 띄우기 (? 이용) 3.삭제=>51번 삭제 후 list다시 띄우기 (pathvariable이용) 3.수정 => 51번 사원정보 수정 후 list 다시 띄우기 list2 주소 처리 => ModelAndView => list2.jsp list3 주소처리 => forward => list3.jsp add/..
2024.02.16 -
handler, response, json
URLMapping @Controller public class TestController { @RequestMapping(value = "/", method = RequestMethod.GET )//get, post 둘다 처리 public String main() {//servlet과 동일 return "main";//응답요청을 할 jsp 파일이름 test.jsp } @RequestMapping(value="/aaa", method=RequestMethod.GET) public String aaa() { System.out.println("aaa 호출"); return "main"; } // aaa2, aaa3 둘다 같은 페이지 호출 @RequestMapping(value= {"/aaa2", "/aaa..
2024.02.16