웹개발 교육/Spring

웹개발 교육/Spring

[78일] Spring (26) - MyBatis 프로젝트 호스팅

수정사항 product_sql.txt create table product ( product_code int AUTO_INCREMENT primary key, product_name varchar(100) not null, description varchar(2000), price int default 0, filename varchar(500), filesize bigint DEFAULT 0 NOT NULL, regdate datetime DEFAULT now() ); comment_sql.txt create table pcomment ( cno int AUTO_INCREMENT primary key -- 댓글번호 , pno int not null -- 부모글 번호 , content VARCHAR(50..

웹개발 교육/Spring

[77일] Spring (25) - MyBatis 프로젝트 (댓글 게시판-목록, 삭제, 수정)

detail.jsp //댓글 목록 function commentList() { $.ajax({ url:'/comment/list' ,type:'get' ,data:{'pno':pno} //부모글번호 ,success:function(data){ //alert(data); let a = ''; //출력할 결과값 $.each(data, function(key, value){ //alert(key); //순서 0 1 2 //alert(value); //[object object] //alert(value.cno); //alert(value.pno); //alert(value.content); //alert(value.wname); //alert(value.regdate); a +='댓글번호:' + value.c..

웹개발 교육/Spring

[76일] Spring (24) - MyBatis 프로젝트 (댓글 게시판)

본문과 댓글은 다른 테이블이지만 동일한 글 번호를 가지고 있어야 한다. test에는 로그인했을 때의 session 변수를 가져와 보여주면 된다. 참고 테이블 생성 -- 상품 댓글 테이블 create table pcomment ( cno number primary key --댓글번호 ,pno number not null --부모글 번호 ,content varchar2(255) not null --댓글내용 ,wname varchar(100) not null --작성자 ,regdate date default sysdate --작성일 ); -- 댓글 시퀀스 create sequence pcomment_seq; commit; 클래스 생성 CommentDTO.java package kr.co.itwill.comme..

웹개발 교육/Spring

[75일] Spring (23) - MyBatis 프로젝트 (삭제)

ProductCont.java @RequestMapping("/delete") public String delete(int product_code, HttpServletRequest req) { String filename = productDao.filename(product_code); if(filename != null && !filename.equals("-")) { ServletContext application = req.getSession().getServletContext(); String path = application.getRealPath("/storage"); File file = new File(path+"\\"+filename); if(file.exists()) { file.del..

웹개발 교육/Spring

[75일] Spring (22) - MyBatis 프로젝트 (수정)

ProductCont.java @RequestMapping("/update") public String update(@RequestParam Map map , @RequestParam MultipartFile img , HttpServletRequest req) { String filename = "-"; long filesize = 0; if(img != null && !img.isEmpty()) { filename = img.getOriginalFilename(); filesize = img.getSize(); try { ServletContext application = req.getSession().getServletContext(); String path = application.getRealP..

웹개발 교육/Spring

[75일] Spring (21) - MyBatis 프로젝트 (상세보기)

값을 전달할 때 지금까지는 위의 방식으로 했다. 하지만 이 방법만 있는 것은 아니고 / 를 사용할 수도 있다. ProductCont.java @RequestMapping("/detail/{product_code}") public ModelAndView detail(@PathVariable String product_code) { ModelAndView mav = new ModelAndView(); mav.setViewName("product/detail"); mav.addObject("product", productDao.detail(product_code)); return mav; }//detail() end /* @RequestParam http://192.168.0.1:9090?aaa=bbb&ccc..

ewok
'웹개발 교육/Spring' 카테고리의 글 목록