전체 글
-
게시판 번호 설정 (SelectKey 지정 에러)기타 2023. 4. 14. 12:08
selecting key or setting result to parameter object Mapper.xml에서 글을 쓸 때 select max(board_no)+1 board_no from port_board insert into port_board(board_no, title, contents, id) values(#{board_no}, #{title}, #{contents}, #{id}) 명령어를 실행한다 이 때 table에 데이터가 하나도 없고 board_no가 null 값으로 지정되어 있다면, selectKey 를 불러올 때 기존에 board_no 가 null이기 때문에 max(board_no)+1 board_no 를 찾을 수가 없어서 에러가 발생한다. table에 행을 하나 추가해서 max..
-
변수에 null 값이 들어갈 때 생기는 오류 ( java.lang.NumberFormatException )기타 2023. 4. 12. 12:41
WARN : org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver - Failed to bind request element: org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'int'; nested exception is java.lang.NumberFormatException: For input string: "undefined" 댓글을 삭제한 후, list를 불러오지 못하고 해당 오류가 발행했다. funct..
-
css 블록 height 지정 팁기타 2023. 4. 12. 10:13
- 위의 그림에 수정 , 삭제 버튼은 같은 제목이나 content와 같은 폼 태그 내부에 있으면서도, 오른쪽 정렬을 위해 float : right 를 줬더니 form 태그 밖으로 벗어났다. 이런 경우는 absolute나 float 처럼 블록이 같은 z 축 위에서 뜨는 속성을 줄 경우, 해당 요소를 포함하는 div가 높이 값을 가지지 못하기 때문이다. - 보이는 것과 같이 detail-btn-box 내부에는 detail-btn-box-right 가 있고, 그 안에 수정, 삭제 버튼이 있다. 하지만, detail-btn-box-right 가 float 이기 때문에, detail-btn-box 는 높이값을 잃어버렸다. 이 때 다음과 같은 설정을 해줌으로서 이를 방지할 수 있다. #detail-btn-box:a..
-
회원가입, 로그인, 게시판 백엔드 실습 ( 1차 마무리 )카테고리 없음 2023. 4. 10. 16:45
Spring 프레임워크를 이용해 회원가입, 로그인, 게시판 구현 실습 : 무료 HTML 템플릿을 이용해서 반응형 UI를 가진 웹 사이트를 구현했다. jsp 파일에 css와 javaScript를 추가하고, java를 통해서 데이터를 xml, json 형태로 mysql에 저장하거나 불러오면서 유저가 브라우저에 입력한 정보를 데이터베이스에 저장하거나 데이터베이스로부터 데이터를 받아와서 브라우저에 나타낼 수 있도록 했다. 로그인, 회원가입은 동기식으로 데이터를 처리했고 게시글의 상세보기 페이지에 나타나는 댓글 데이터를 비동기식으로 처리했다. 해당 게시글에서는 기본적인 기능 구현을 마친 작업 내용을 저장하고, 앞으로 추가할 기능들에 대해 기록하려고 한다. 1. 메인 페이지 - 부트스트랩을 이용해서 만든 무료 HT..
-
ajaxSpring 2023. 4. 10. 10:51
ajax란? : Asynchronous JavaScript and XML의 약자로 자바스크립트 라이브러리 중 하나이다. 웹 페이지 전체를 다시 로딩하기 않고도 웹 페이지의 일부분만을 갱신할 수 있으며, 백그라운드 영역에서 서버와 통신하며 그 결과를 웹 페이지의 일부분에 표시할 수 있다. 따라서 비동기식 방법으로 클라이언트와 서버 간에 XML 데이터를 주고받는 기술이다. ( Json이나 Xml 두가지 형태로 데이터를 갱신할 수 있다. ) ** 비동기 방식은 웹 페이지에서 요청이 있지 않는 상황에서도 프로그램이 계속 돌아가고 있다. 그렇기 때문에, 처리 방식도 빠르고 화면을 리로드 하는 경우 필요한 부분의 리소스만 가져올 수 있다. -> JavaScript를 통해 백 그라운드에서 데이터의 처리와 브라우저에 ..
-
링크 모음기타 2023. 4. 6. 16:34
https://inpa.tistory.com/entry/BootStrap5-%F0%9F%93%9A-%EB%B6%80%ED%8A%B8%EC%8A%A4%ED%8A%B8%EB%9E%A9-%ED%85%9C%ED%94%8C%EB%A6%BF-%EC%82%AC%EC%9D%B4%ED%8A%B8-%EC%A0%95%EB%A6%AC#wrapbootstrap 🔮 부트스트랩 템플릿 사이트 모음집 부트스트랩 템플릿 사이트 모음 Bootstrap는 반응형 웹디자인을 기본으로 하고 있고, 다양한 웹 요소들의 디자인과 기능을 포함하고 있어 손 쉽게 사이트를 제작할 수 있다. 자신의 사이트에 맞는 inpa.tistory.com 부트스트랩 https://www.youtube.com/watch?v=67stn7Pu7s4 유튜브 클론코딩 cs..
-
회원가입, 로그인, 게시판 백엔드 실습( 댓글 리스트 , pagenation )Spring 2023. 4. 6. 15:03
댓글 리스트 , pagenation 작성하기 : get 방식으로 데이터베이스에 있는 데이터를 조회하고 JavaScript로 데이터를 브라우저에 나타낼 것이다. 1) JavaScript 작성 $(document).ready(function(){ var board_noValue=$("input[name='board_no']").val(); var pageValue=1; // detail.jsp가 시작되자마자 댓글목록리스트(list) 함수를 호출 list({board_no:board_noValue,page:pageValue}); // 페이지네이션의 페이지를 클릭하면 해당 페이지의 댓글을 호출 $("#replyPage").on("click","li a",function(e){ alert("aaa") e.prev..
-
회원가입, 로그인, 게시판 백엔드 실습( 댓글 작성 )Spring 2023. 4. 6. 14:51
댓글 작성하기 : 댓글 작성의 목표는 유저가 작성한 댓글(content) 와 댓글의 번호, session에 저장되어 있는 아이디를 댓글 table에 비동기식 함수를 사용해서 저장할 것이다. 1) JavaScript 작성하기 $(document).ready(function(){ var board_noValue=$("input[name='board_no']").val(); $("#add").on("click",function(){ var contentValue=$("#content").val(); // 댓글쓰기를 하기 위한 함수 호출 add({board_no:board_noValue,content:contentValue}); }) } function add(reply){ $.ajax({ type:"post"..