course 2021/JSP

course 2021/JSP

JSP17 - 14bootstrap

bootstrap 4버전: https://getbootstrap.com/docs/4.6/layout/overview/ Overview Components and options for laying out your Bootstrap project, including wrapping containers, a powerful grid system, a flexible media object, and responsive utility classes. getbootstrap.com w3schools bootstrap 4버전 튜토리얼: https://www.w3schools.com/bootstrap4/default.asp Bootstrap 4 Tutorial W3Schools offers free online tut..

course 2021/JSP

JSP16 - 13customTag

교재469 16chapter 커스텀태그 만들기 > 태그파일이 들어가는 위치는 정해져 있음 1. c:\apache-tomcat-8. O.21\,webapps\chap16 폴더를 생성 2. chap16 폴더에 WEB-INF 하위 폴더를 생성 3. WEB-INF 폴더에 lib 폴더를 생성하고 jstl-1. 2.jar 파일을 복사 4. WEB-INF 폴더에 tags 하위 폴더를 생성 webapp > WEB-INF > lib, (tags > 13tag) 폴더생성 13tag 우클릭 new - other - tag 검색 - JSP Tag 선택하여 파일명.tag 로 파일 생성하기 t01tag.tag, 01tag.jsp (t01tag.tag 는 tag 폴더 안에, 01tag.jsp 는 13customTag 폴더 안에) ..

course 2021/JSP

JSP15 - 12jstl

시작하기 전, jstl 을 사용하려면 https://tomcat.apache.org/download-taglibs.cgi Apache Tomcat® - Apache Taglibs Downloads Welcome to the Apache Taglibs download page. This page provides download links for obtaining the latest version of the Apache Standard Taglib, as well as links to the archives of older releases. You must verify the integrity of the downloaded files. We pro tomcat.apache.org tomcat 홈페이지 >..

course 2021/JSP

JSP14 - 11el(3)

41paramValues el paramValues 기본객체 0 : 1 : 2 : \${paramValues.param1[0] } : ${paramValues.param1[0] } \${paramValues.param1[1] } : ${paramValues.param1[1] } \${paramValues.param1[2] } : ${paramValues.param1[2] } el 로 안하면 로 꺼내야하고, el 로 하면 ${paramValues.param1[0]} 로 반환하면 된다는 거지 - paramValues : 요청 파라미터의 매핑을 저장한 Map 객체이다. 파라미터 값 타입은 String[] 로서 request.getParamaterValues(name)..

course 2021/JSP

JSP13 - 11el(2)

21map-baen Map map = new HashMap(); Bean04 obj = new Bean04(); obj.setNickName("korea"); obj.setAge(30000); obj.setVip(true); map.put("key1", obj); pageContext.setAttribute("data", map); pageContext.setAttribute("key1", "key1"); pageContext.setAttribute("nickName", "nickName"); pageContext.setAttribute("age", "age"); pageContext.setAttribute("vip", "vip"); pageContext.setAttribute("key2", "seoul..

course 2021/JSP

JSP12 - 11el

java bean 속성(데이터), 변경 이벤트, 객체 직렬화를 위한 표준. JSP 에서는 속성을 표현하기 위한 용도로 사용됨. get set 메소드에 의해 결정됨 property 의 이름은 get, set 메소드의 get, set 을 지우고 앞글자를 소문자로 함 ex) public String getValue1(){ return Value1; } public void setValue1(String value1){ Value1 = value1; } *property 값에는 읽기전용과 읽기/쓰기 가 있다 읽기전용 property: get 또는 is 메소드만 존재하는 property 읽기/쓰기 property: get/set 또는 is/set 메소드가 존재하는 property *property type 이 b..

course 2021/JSP

JSP11 - 10scope

01scope java web app 의 4개의 영역(영역=scope) -교재 132p 참고 1) page: 하나의 jsp 페이지 2) request: 하나의 http 요청 3) session: 하나의 브라우저 4) application: 하나의 웹 어플리케이션 02page page 영역 pageContext.~ request, response 같은 페이지라서 setAttribute 로 값을 넣고 getAttribute 로 값을 꺼낼 수 있다 (object 로 반환되므로 형변환) 03pageMain, pageSub main set 으로 pageAttr2 에 pageVal2 저장, sub 파일 갑자기 삽입, get 으로 pageAttr2 에 저장된 값 반환 sub get 으로 pageAttr2 값 반환 →..

course 2021/JSP

JSP10 - 09cookie

01cookie Request Headers 에 쿠키명=값 을 쌍으로 들고다님 쿠키를 주고받는 연습 쿠키는 브라우저, 세션은 서버에 저장 (설명 ↓ java.util.Enumeration getHeaderNames() Returns an enumeration of all the header names this request contains. If the request has no headers, this method returns an empty enumeration. Some servlet containers do not allow servlets to access headers using this method, in which case this method returns null 이 요청에 포함된 모..

course 2021/JSP

JSP09 - 08session

01session 기본객체 중 하나이다 (이전 게시글에서 잠깐 다루었다 - 타입, 설명, 메소드까지) 서로다른 브라우저에서 공유하지 않는다 (값 전달 불가) ex.크롬, 사파리, 시크릿모드 등 같은 브라우저에서 온 request 가 공유한다 count 를 받아옴. null 이면 1을 저장함. count 반환. count 1 늘려서 다시 저장. 새로고침을 할 때마다 1씩 증가한다 02session 세션을 유지하는 방법 첫번째 요청에 대한 응답에 쿠키를 포함, 두번째 요청부터 같은 쿠키를 가지고 있으면 같은 브라우저에서 온 요청이라고 판단. 03attribute1,2,3 파일1 에서 session.setAttribute 로 food=apple 전달함 파일2,3 에서 food 값 반환 (apple) 그런데 어..

course 2021/JSP

JSP08 - 07redirect

갑자기 session? session 은 일단 기본객체 중 하나 타입: javax.servlet.http.httpSession 설명: http 세션 정보를 저장함 복붙설명: 세션이란 서버측의 컨테이너에 관리되는 정보로써 이 정보는 컨테이너에서 접속해서 종료되기까지 유지되며 접속 시간에 제한을 두어 일정 시간 응답이 없다면 정보는 더 이상 유지되지 않게 설정이 가능하다. 이것은 정보가 서버측에서 저장된다는 점에서 보안적으로 유리, 즉 세션은 client 와 server 간의 접속을 유지시켜주는 역할 - 서버쪽에서 웹컨테이너의 상태를 유지하기 위해서 정보를 저장하는 객체 (방법) -웹 브라우저당 한개의 세션 정보를 생성하여 사용 - 접속시간에 제한을 두어 일정시간 응답이 없으면 유지 못하게 설정이 가능 --..

코딩하는토끼
'course 2021/JSP' 카테고리의 글 목록