Dorothy_YANG
With Dorothy
Dorothy_YANG
전체 방문자
오늘
어제
  • 분류 전체보기 (279)
    • Hi, I'm Dorothy 🕵️‍♂️ (21)
      • Slowly but Surely (18)
      • IT certifications (3)
    • 🤯TIL (80)
      • HTML & CSS (2)
      • Javascript & jQuery (13)
      • React (13)
      • C언어 (1)
      • JAVA (22)
      • Python (2)
      • Oracle SQL (10)
      • My SQL (5)
      • Spring (12)
    • 💻Programmers (17)
    • 🏫 Open API_JAVA (101)
    • 🌎 Project (10)
      • Shopping (10)
    • 💥 Error (24)
    • ⚙ Setting (23)

블로그 메뉴

  • 홈
  • 방명록

공지사항

인기 글

태그

  • 이것이자바다
  • SQL
  • CSS
  • Database
  • 기간쿼리
  • spring
  • 백준
  • 노마드코더
  • java
  • 창초기화
  • HTML
  • AllArgsConstructor
  • 콜라보레이토리
  • 서버등록
  • 비쥬얼스튜디오코드
  • 시작일종료일
  • Eclipse
  • 독학후기
  • colaboratory
  • 기간설정
  • sql기간
  • SQLD합격후기
  • 오류해결
  • SQLD합격
  • 연습문제
  • oracle
  • 코딩앙마
  • 파이썬온라인
  • googlecolaboratory
  • Javascript

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
Dorothy_YANG

With Dorothy

[게시판 만들기 - 4 ] 게시판 수정하기 / 삭제하기
🤯TIL/Spring

[게시판 만들기 - 4 ] 게시판 수정하기 / 삭제하기

2022. 12. 9. 17:42
728x90

목 차

7. 게시판 수정 / 삭제
     - 작업1> Controller : 매핑주소 및 메서드 작업 
     - 작업2> Mapper interface와 Mapper XML작업 
                    - Mapper Interface : 메서드 작업
                    - Mapper XML : SQL 구문작업
     - 작업3> Service 작업 
                   -Service인터페이스 : 추상 메서드 작업
                   -Servicelmpl(구현) 클래스 : 메서드 구현 
     -작업4> Controller : Service의 메서드 호출
     [-작업5> VIEW 처리 : modify.jsp 파일 생성] ➡ remove에선 생략

 


< 게시글 수정하기 >

작업1> Controller : 수정 매핑주소 및 메서드 작업 


작업2> Mapper interface와 Mapper XML작업 

               - Mapper Interface : 메서드 작업
               - Mapper XML : SQL 구문작업


작업3> Service 작업 

               -Service인터페이스 : 추상 메서드 작업
               -Servicelmpl(구현) 클래스 : 메서드 구현 


작업4> Controller : Service의 메서드 호출 

  • get 주소에 modify 주소 추가


작업5> VIEW 처리 : list.jsp 파일 생성

(1) 추가

       <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>      

 

(2) 

<!--------------------------
        | Your Page Content Here |
        -------------------------->

<div class="row">
    <div class="col-md-12">
        <div class="box box-primary">
            <div class="box-header with-border">
            <h3 class="box-title">게시판 글수정</h3>
            </div>


            <form role="form" method="post" action="modify">
                <div class="box-body">
                    <div class="form-group">
                    <label for="bno">Bno</label>
                    <input type="text" class="form-control" id="bno" name="bno" value="<c:out value="${board.bno }" />" readonly>
                    </div>
                    <div class="form-group">
                    <label for="title">Title</label>
                    <input type="text" class="form-control" id="title" name="title" placeholder="제목 입력" value="<c:out value="${board.title }" />">
                    </div>
                    <div class="form-group">
                    <label for="content">Content</label>
                    <textarea class="form-control" aria-label="With textarea" name="content"><c:out value="${board.content }" /></textarea>
                    </div>

                    <div class="form-group">
                    <label for="writer">Writer</label>
                    <input type="text" class="form-control" id="writer" name="writer"  placeholder="작성자 입력" value="<c:out value="${board.writer }" />" readonly>
                    </div>

                </div>

                <div class="box-footer">
                    <button type="submit" class="btn btn-primary">Save</button>
                </div>
            </form>
        </div>
    </div>
</div>

 

 

ex) 실행화면

팝업창 메세지는 list.jsp에 들어간다.

 

 


< 게시글 삭제하기 >

작업1> Controller : 삭제 매핑주소 및 메서드 작업 


작업2> Mapper interface와 Mapper XML작업 

               - Mapper Interface : 메서드 작업
               - Mapper XML : SQL 구문작업


작업3> Service 작업 

               -Service인터페이스 : 추상 메서드 작업
               -Servicelmpl(구현) 클래스 : 메서드 구현 


작업4> Controller : Service의 메서드 호출 

 

 

 

ex) 실행 화면

728x90
저작자표시

'🤯TIL > Spring' 카테고리의 다른 글

[어노테이션] @ResponseBody / @ResponseEntity<T> / @RequestParam("") 정리  (0) 2022.12.15
[게시판 만들기] 코드 총정리 (*ONLY CRUD)  (0) 2022.12.11
[게시판 만들기 - 3 ] 게시판 읽기  (0) 2022.12.06
[게시판 만들기 - 2 ] 게시판 목록  (0) 2022.12.05
[게시판 만들기 - 1 ] 글쓰기 폼 만들기 / 글쓰기 저장  (0) 2022.12.05
    '🤯TIL/Spring' 카테고리의 다른 글
    • [어노테이션] @ResponseBody / @ResponseEntity<T> / @RequestParam("") 정리
    • [게시판 만들기] 코드 총정리 (*ONLY CRUD)
    • [게시판 만들기 - 3 ] 게시판 읽기
    • [게시판 만들기 - 2 ] 게시판 목록
    Dorothy_YANG
    Dorothy_YANG
    Slowly but Surely, 비전공 문과생의 개발공부

    티스토리툴바