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)

블로그 메뉴

  • 홈
  • 방명록

공지사항

인기 글

태그

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

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
Dorothy_YANG
🤯TIL/Spring

[게시판 만들기 - 3 ] 게시판 읽기

[게시판 만들기 - 3 ] 게시판 읽기
🤯TIL/Spring

[게시판 만들기 - 3 ] 게시판 읽기

2022. 12. 6. 19:22
728x90

목 차

6. 게시판 읽기
     - 작업1> Controller : 읽기 매핑주소 및 메서드 작업 
     - 작업2> Mapper interface와 Mapper XML작업 
                    - Mapper Interface : 메서드 작업
                    - Mapper XML : SQL 구문작업
     - 작업3> Service 작업 
                   -Service인터페이스 : 추상 메서드 작업
                   -Servicelmpl(구현) 클래스 : 메서드 구현 
     -작업4> Controller : Service의 메서드 호출
     -작업5> VIEW 처리 : get.jsp 파일 생성


작업1> Controller : 리스트 매핑주소 및 메서드 작업 



작업2> Mapper interface와 Mapper XML작업 

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


작업3> Service 작업 

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



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

 


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

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("#btnModify").click(function(){
let bno = $(this).data("bno");
location.href = "/board/modify?bno=" + bno;
});
$("#btnRemove").click(function(){
if(!confirm("삭제 하시겠습니까?")) return;
let bno = $(this).data("bno");
location.href = "/board/remove?bno=" + bno;
});
});
</script>

 

      <!--------------------------
        | 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">Dorothy's Board 조회</h3>
</div>
<div class = "box-body">
<div class = "form-group">
<label for = "title">Bno</label>
<input type = "text" class = "form-control" value = "${board.bno}" readonly>
</div>
<div class = "form-group">
<label for = "title">Title</label>
<input type="text" class="form-control" value="${board.title}" readonly>
</div>
<div class="form-group">
<label for="content">Content</label>
<%-- <input type="text" class="form-control" value="${board.content}" readonly>--%>
<c:out value="${board.content}" />
</div>
<div class="form-group">
<label for="writer">Writer</label>
<input type="text" class="form-control" value="${board.writer}" readonly>
</div>
<div class="form-group">
<label for="writer">Regdate</label>
<input type="text" class="form-control" value="<fmt:formatDate value="${board.regdate}" pattern="yyyy-MM-dd hh:mm"/>" readonly>
</div>
<div class="form-group">
<label for="writer">Updatedate</label>
<input type="text" class="form-control" value="<fmt:formatDate value="${board.regdate}" pattern="yyyy-MM-dd hh:mm"/>" readonly>
</div>
<button type="button" class="btn btn-primary" id="btnModify" data-bno="${board.bno}">Modify</button>
<button type="button" class="btn btn-primary" id="btnRemove" data-bno="${board.bno}">Remove</button>
<button type="button" class="btn btn-primary" id="btnList">List</button>
</div>
</div>
</div>
</div>
</section>

 

 

ex) 실행 화면

 

728x90
저작자표시 (새창열림)

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

[게시판 만들기] 코드 총정리 (*ONLY CRUD)  (0) 2022.12.11
[게시판 만들기 - 4 ] 게시판 수정하기 / 삭제하기  (0) 2022.12.09
[게시판 만들기 - 2 ] 게시판 목록  (0) 2022.12.05
[게시판 만들기 - 1 ] 글쓰기 폼 만들기 / 글쓰기 저장  (0) 2022.12.05
[코배스] Part 3-1. 기본적인 웹 게시물 관리 / 게시판 만들기  (0) 2022.11.21
  • 목 차
  • 작업1> Controller : 리스트 매핑주소 및 메서드 작업 
  • 작업2> Mapper interface와 Mapper XML작업 
  • 작업3> Service 작업 
  • 작업4> Controller : Service의 메서드 호출 
  • 작업5> VIEW 처리 : get.jsp 파일 생성
'🤯TIL/Spring' 카테고리의 다른 글
  • [게시판 만들기] 코드 총정리 (*ONLY CRUD)
  • [게시판 만들기 - 4 ] 게시판 수정하기 / 삭제하기
  • [게시판 만들기 - 2 ] 게시판 목록
  • [게시판 만들기 - 1 ] 글쓰기 폼 만들기 / 글쓰기 저장
Dorothy_YANG
Dorothy_YANG
Slowly but Surely, 비전공 문과생의 개발공부

티스토리툴바

개인정보

  • 티스토리 홈
  • 포럼
  • 로그인

단축키

내 블로그

내 블로그 - 관리자 홈 전환
Q
Q
새 글 쓰기
W
W

블로그 게시글

글 수정 (권한 있는 경우)
E
E
댓글 영역으로 이동
C
C

모든 영역

이 페이지의 URL 복사
S
S
맨 위로 이동
T
T
티스토리 홈 이동
H
H
단축키 안내
Shift + /
⇧ + /

* 단축키는 한글/영문 대소문자로 이용 가능하며, 티스토리 기본 도메인에서만 동작합니다.