전체 글
-
0921. 회원가입정보 저장하기카테고리 없음 2023. 9. 21. 18:35
Ajax Asynchronous 비동기 *모든 I/O 자바스크립트는 비동기 (통신) JSON 서버로부터 데이터를 받으려면 요청을 보내야 서버가 응답을 할 때 응답 속에 데이터가 들어있다. 1. 브라우저 창에 주소 입력 2. 주소 지정 3. form = action에 주소 지정 => 요청하면 브라우저가 페이지를 바꿔서 다시 렌더링을 해야하는 번거로움이 있다. 전체 페이지는 유지하면서 페이지변경은 안 하고(브라우저가 현재 페이지 유지) 그럼 브라우저 자체가 요청을 보낼 수는 없고(그럼 바뀜) 자바스크립트가 서버와 개별통신을 하면 (요청 & 응답) 수신한 데이터를 가공해서 동적으로 화면에서 동조작을 통해 업데이트 하는 것이다. ex) 지도, 메일, 댓글처리 => 거의 대부분 Ajax 기술을 내포 SignUp(..
-
0920. UserDetail카테고리 없음 2023. 9. 21. 18:35
UserDetail 사용자 정보를 데이터베이스에서 처리하기 위해 UserDetail 사용하기 하나의 유저가 여러 권한을 가지고 있다는 뜻 primary key(username, auth), jsp에서 로그인한 사용자 정보 보여주기 principal 본인(주체) 로그인한 당사자를 나타내는 단어 principal 파트가 (로그인 안 해서) null이면 에러가 뜬다. 로그인 url 에서 직접 로그인해서 들어가야 한다. 디비버 DB 추가 drop table if exists tbl_member; create table tbl_member( username varchar(50) primary key, password varchar(128) not null, email varchar(50) not null, reg..
-
0918. Spring Form Tag 라이브러리Spring 2023. 9. 20. 09:04
Spring Framework JSP Form Tag Library ○ 모델 객체를 Form에 자동으로 바인딩해줌 ○ taglib 디렉티브 select, checkbox, radio button 등을 사용할 때 편하다. form 태그 라이브러리를 사용하면 유효성 검사로 에러메시지 출력을 쉽게 할 수 있다. v Spring Framework JSP Form Tag Library 새 패키지 ex03 starter에서 복사 후 pom.xml에서 ex03으로 수정 views에 layout폴더 복사(헤더 등 jsp) domain 폴더 생성 후 MemberVO (난 @Data도 추가) Contoller 폴더에 TestController 생성 - join 사용 - get처리에도 모델객체 제시 - post에 error..
-
0915. 여행 페이지를 만들자Spring 2023. 9. 15. 18:22
사전 준비 테이블 준비 int이기만 한 no를 실제 pk로 설정하기. alter 사용 select * from travel; -- 기존 컬럼 no에 pk, auto_increment 배정 alter table travel modify no int auto_increment primary key; 테이블 준비 끝 **여행 페이지 만들기 시작 순서** 0) DB에서 테이블 정의 1) VO 객체 정의 (테이블에 대응하는) => TravelVO 2) Mapper 인터페이스 정의 3) Mapper xml 정의 -> 테스트 4)Service 인터페이스 정의 + 구현 -> 구현한 걸로 테스트 5) Controller 정의 6) jsp (화면 정의) VO 객체 정의 ➡️ Mapper 인터페이스 정의 ▶ Mapper x..
-
0914. 검색처리카테고리 없음 2023. 9. 15. 09:07
게시물의 검색 기능 like 를 써서 '%xxx%' 제목, 내용, 작성자와 같이 단일 항목 검색 단일 말고 이 중 두 개씩, 3개 다 묶어서 할 수도 있다. 어떻게 쓸지는 사용자가 정하므로 MyBatis 동적 SQL 이 필요하다. **MyBatis의 동적태그들** -if : 조건이 참인 경우에만 추가해라. else 없음 -choose(when, otherwise) : 다중 if문 역할 -trim(where, set) : 덧붙이거나 뺄 때 -foreach : 루프 돌릴 때 내용이 false면 추가 안 됨. *T : title, C: content, W: writer 검색 대상 : type == ~ . T, C, W 이면 문자열로 변환시켜서 빨간 화살표 옆을 넣어라 ❗CONCAT (문자열 합치기) 을 쓰는 ..
-
0907. Model 데이터 전달자, Redirect카테고리 없음 2023. 9. 8. 17:39
HomeController 모델 객체는 자동으로 넘어간다. @ModelAttribute https://web-obj.tistory.com/485 엘리먼트 내에서 속성의 qualified 이름들은 반드시 유일해야 합니다. 안에 name 속성을 두번써서 발생하였다. 아래와 같이 써서 문제가 발생한 것인데, name="mberVO" 를 하나 삭제하니 오류가 나오지 않는다. 1 2 Colored by Color Scripter cs 아래와 같이 변경. 1 2 Colored by Color S web-obj.tistory.com @GetMapping("/ex04") public String ex04( Model model, @ModelAttribute("sample")SampleDTO dto, @ModelAttr..
-
0904. 세션 관리JSP-Servlet 2023. 9. 5. 09:02
*chapter 06 프로젝트 세션의 생성과 종료 사용자의 상태 정보를 서버에서 관리 일정시간 동작 없으면 자동 로그아웃됨 (세션만료) 톰캣은 기본 30분으로 변경가능하고 금융권은 10분 정도이다. 쿠키 : 리퀘스트 head에 세션값을 저장해서 클라이언트와 연결을 유지. 세션아이디는 브라우저를 바꾸지 않는 이상 동일한 값이다. 브라우저를 모두 종료하고 다시 열면 다른 값이 부여된 세션아이디가 생성된다. 즉 세션은 브라우저를 식별하는 것 request 객체를 통해 getSessiong() 하면 session scope에 접근가능 정보넣기 : set, 꺼내기 : get, 제거: remove 세션시간 유지 기준은 : 처음 생성시간이 아니라 마지막 요청시점부터 연장되는 것 -> Time Out 로그아웃 처리 :..
-
0829. JSP/Servlet - URL, 웹서버와 웹컨테이너JSP-Servlet 2023. 8. 29. 18:15
JSP/Servlet -> Spring 📍URL Uniform Resource Locator 웹에서 사용하는 자원을 지칭하는 유일한 식별표기법 브라우저의 주소창에 나오는 것 *URI는 information이라 유일하게 식별할 수 있는 정보이기만 하면 된다. Locator는 위치정보를 가지고 있다. (어느 디렉토리 밑에 ...) URL 표기방법 프로토콜 : http, https 등 주소 : ip, domain 등이 될 수 있다. 포트번호 : 디폴트 사용 시 생략가능(80번이 아닌 다른 포트로 서버가 연결될 때는 명시해야 한다) 경로 : 슬래시 이하 "path" 클라이언트와 서버 구조 🌱 웹 어플리케이션이란? 웹서버를 통해서 요청이 들어왔을 때 어떤 매커니즘과 처리로 응답을 내보낼지 규정하는 것 편하게 하기..