본문 바로가기
#4-3 / gallery board select-list (spring + I/O + database) 👀 list - dao 수정 : 첨부파일도 가지고오려고..! (썸네일 타입 board list)package shop;import java.util.ArrayList;import java.util.Arrays;import lombok.Getter;import lombok.Setter;@Getter@Setterpublic class gallery_dao { int gidx; String gwriter,gsubject,gtext; String gorifile,gfile; String gindate; //list 페이지에서 필요한것만! //=> 첨부하지 않을경우,첨부할 경우 배열 length가 달라질 수 있기 때문에 아예 분리해서 받는게 좋다! public ArrayList lists(){ .. 2024. 7. 11.
#4-2 / gallery board insert-write (spring + I/O + database) ❗ board 파일 첨부시파일 저장 후에 ===> DB에 저장되어야 함  1. table 만듬 create table gallery( gidx int(7) not null auto_increment, gwriter char(100) not null, gsubject varchar(200) not null, gtext text not null, gorifile text null, //사용자가 업로드한 파일명  gfile text null, //저장시 랜덤함수를 이용하여 저장된 파일명 gindate timestamp not null default current_timestamp, primary key(gidx) );  2. gallery_dao.java 생성 : getter,setter 첨부하지 않을경우 ,.. 2024. 7. 11.
#4-1 / spring + I/O [file I/O 정리] commons-upload => pom.xmlwebpage.xml => defaultEncoding,maxUploadSize="-1",maxlnMemorySize(속도향상) : 단점- 메모리 과부하로 인하여 서버가 shutdown될 수 있음Front-end : 파일첨부1개, 파일첨부 여러개, 파일첨부 1개씩 여러개 담을 경우Java Controller에서 @RequestParam("name명") MultipartFile 객체명FileCopyUtils.copy() 를 이용해 웹 디렉토리 출력가능commons-upload 라이브러리 : localhost서버, CDN서버에서 사용 가능(상대방 서버) [ I/O 파일 업로드 라이브러리 사용 - setting ]mvnrepository 여.. 2024. 7. 11.
#3-2 / coupon delete,update (spring + database) https://dev-eunse.tistory.com/198 여기 list에서 삭제,수정  👀 삭제 1. shop_main.java 에 추가 : @GetMapping("/coupon_del.do")/*-- 쿠폰 delete --*/@GetMapping("/coupon_del.do")public void coupon_del(int cidx, HttpServletResponse res) throws Exception{ res.setContentType("text/html;charset=utf-8"); String callback = new coupon_insert().del_result(dbInfo, cidx); this.pw= res.getWriter(); if(callback ==.. 2024. 7. 10.