SlideShare ist ein Scribd-Unternehmen logo
1 von 10
WEB...
- 현재 WAP 구성 형태 순차적으로 처리
- Action 또는 View마다 하나의 자원(JSP)이 필요
- Static Method를 주로 사용
HTML 코드를 재사용                                스크립틀렛을
                                               줄이고 간략히
                                                 표현




- Client 요청을 처리하는 객체를 ServletController로 단일화
- Model -> Data Object , Controller -> Servlet, View -> JSP
 값을 가져오는 형태
 String name = request.getParameter(“name”);
 값을 Request에 저장하는 형태
 MemberDTO dto = new MemberDTO();
 request.setAttribute(“dto”, dto);
CUSTOM TAG

                                                                       예) 테이블 목록

                                                                    <address mode=”list”/>

                                                                    등으로 사용가능
1.   <%@ page import="package.classFile" %>
2.   <%@ taglib uri="/WEB-INF/taglib.tld" prefix="honey" %>
     <honey:printName />




                                                예) 프로필 사용

                                              <profile id=”desk”/>

                                              등으로 사용가능
SERVLET & DISPATCHER
public class MyServlet extends HttpServlet {
   protected void doPost(HttpServletRequest request, HttpServletResponse
response)
         throws ServletException, IOException {

        String name = request.getParameter(“name”);
        Member name = new Member(name);

        ....... 처리 .......

        request.setAttribute("result", member);

        ServletContext sc = getServletContext();
        RequestDispatcher rd = sc.getRequestDispatcher("/view.jsp");

        rd.forward(request, response);
        또는 rd.include(request, response);

    }     1. JSP를 View로 사용하고 (JSP는 Servlet에서 생성한 결과만 출력하는 기능)
}         2. Servlet내에 doGet, doPost (각각 get, post 메소드를 처리) 내에서 비지니스
          로직을 처리
          3. 응답은 request, session등 상황에 맞는 저장소에 저장
          4. 페이지 제어권 용도에 따라서 forward, include를 통해 View로 결과 보냄
FILTER
  Web어플리케이션 전반에 영향을 끼치는 모듈
클래스 작성
public interface Filter {
   public abstract void init(FilterConfig filterconfig) throws ServletException;
   public abstract void doFilter(ServletRequest servletrequest, ServletResponse servletresponse, FilterChain filterchain)
         throws IOException, ServletException;
   public abstract void destroy();
}                                                                                        모든 URL에
 필터적용
<filter-mapping>
                                                                                     SetCharacterEncdoin
      <filter-name>SetCharacterEncodingFilter</filter-name>
      <url-pattern>/*</url-pattern>
                                                                                      gFilter 를 적용함
   </filter-mapping>

 예) 동작하는 필터
 예 ) public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,
          ServletException {

       if(request instanceof HttpServletRequest) {

          HttpServletRequest httpRequest = (HttpServletRequest)request;  // class casting
          HttpServletResponse httpResponse = (HttpServletResponse)response;  // class casting

          String userAgent = httpRequest.getHeader("user-agent").toUpperCase();
      }
JSTL :          The expression language
기존 코드 유형
                                           <% %> 안에 작성하는 JSP
<% if (user.getRole() == "member")) { %>
    <p>Welcome, member!</p>
<% } else { %>
                                           스크립트 코드들과 많은
    <p>Welcome, guest!</p>
<% } %>                                    양의 HTML로 복잡해지는
    JSTL                                     코드의 작성을 쉽게
<jsp:setProperty name="user" property="timezonePref"
                 value='<%= request.getParameter("timezone") %>'/>



  JSTL, 표현식
<c:out value="${user.firstName}"/>




<c:set var="timezone" scope="session" value="CST"/>




                                      http://slog2.egloos.com/3581446
인증                     실체 확인 : 로그인
<web-app xmlns="http://caucho.com/ns/resin"          public class MyAuthenticator extends AbstractAuthenticator
            xmlns:resin="urn:java:com.caucho.resin"> {
  <-- Authentication mechanism -->                     private PasswordUser _user;
  <resin:BasicLogin/>
                                                       public MyAuthenticator()
  <-- Role-based authorization -->                     {
  <resin:Allow url-pattern="/foo/*">                     _user = new PasswordUser("harry", "quidditch",
     <resin:IfUserInRole role="user"/>                                             new String[] { "user" });
  </resin:Allow>                                       }

  <-- The authenticator -->                              public PasswordUser getUser(String userName)
  <resin:DatabaseAuthenticator'>                         {
    <resin:data-source>test</resin:data-source>            if (userName.equals(_user.getName()))
    <resin:password-query>                                   return _user;
      SELECT password FROM login WHERE username=?          else
    </resin:password-query>                                  return null;
    <resin:cookie-auth-query>                            }
      SELECT username FROM LOGIN WHERE cookie=?      }
    </resin:cookie-auth-query>
    <resin:cookie-auth-update>
      UPDATE LOGIN SET cookie=? WHERE username=?             예) 사용자 인증 코드
    </resin:cookie-auth-update>
    <resin:role-query>
      SELECT role FROM LOGIN WHERE username=?         <web-app xmlns="http://caucho.com/ns/resin"
    </resin:role-query>                                           xmlns:resin="urn:java:com.caucho.resin">
  </resin:DatabaseAuthenticator>                        ...
</web-app>                                              <resin:XmlAuthenticator password-digest="none">
                                                          <resin:user name="Harry Potter" password="quidditch" group=

   사용자 인증에 대한 내                                           <resin:user name="Draco Malfoy" password="pureblood" group=
                                                        </resin:XmlAuthenticator>
                                                        ...

    용을 web.xml에 설정                                    </web-app>
인가    자원에 대한 접근 권한
<web-app xmlns="http://caucho.com/ns/resin"
            xmlns:resin="urn:java:com.caucho.resin">

  <resin:BasicLogin/>

  <resin:Allow url-pattern="/foo/*">
     <resin:IfUserInRole role="user"/>
  </resin:Allow>

  <resin:XmlAuthenticator>
     ...
  </resin:XmlAuthenticator>

</web-app>



<web-app xmlns="http://caucho.com/ns/resin"

  ...
            xmlns:resin="urn:java:com.caucho.resin">

  <resin:Allow url-pattern="/webdav/*">
                                                       view에서 권한
    <resin:IfUserInRole role='webdav'/>
  </resin:Allow>
  ...
                                                        에 따라 처리
</web-app>


  인증, 권한에 대한 내용
   을 코드가 아니라
    web.xml에 설정
RESTFUL
1.	 HTTP	 프로토콜의	 PUT,	 GET,	 POST,	 DELETE	 등과	 같은	 
Method를	 의미	 그대로	 사용한다.
2.	 Resource에	 대한	 접근을	 URI를	 이용한다.

예)	 HTTP	 request가	 REST	 웹	 서비스

GET	 /book	 HTTP/1.1
Host:	 www.jaso.co.kr
Accept:	 application/xml

위의	 HTTP	 request는	 책	 목록을	 가져	 오기	 위한	 요청입니다.	 특정	 책의	 상세	 정보를	 요청하는	 경우에는	 다음과	 같
이	 할	 수	 있습니다.

GET	 /book/isbn_0001	 HTTP/1.1
Host:	 www.jaso.co.kr
Accept:	 application/xml

특정	 책	 정보를	 삭제하는	 경우는	 다음과	 같습니다.

DELETE	 /book/isbn_0001	 HTTP/1.1
Host:	 www.jaso.co.kr
Accept:	 application/xml

Weitere ähnliche Inhalte

Was ist angesagt?

5-5. html5 connectivity
5-5. html5 connectivity5-5. html5 connectivity
5-5. html5 connectivityJinKyoungHeo
 
5-3. html5 device access
5-3. html5 device access5-3. html5 device access
5-3. html5 device accessJinKyoungHeo
 
Web vulnerability seminar4
Web vulnerability seminar4Web vulnerability seminar4
Web vulnerability seminar4Sakuya Izayoi
 
Web vulnerability seminar3
Web vulnerability seminar3Web vulnerability seminar3
Web vulnerability seminar3Sakuya Izayoi
 
파이썬 웹 프로그래밍 2탄
파이썬 웹 프로그래밍 2탄 파이썬 웹 프로그래밍 2탄
파이썬 웹 프로그래밍 2탄 SeongHyun Ahn
 
챗봇 시작해보기
챗봇 시작해보기챗봇 시작해보기
챗봇 시작해보기성일 한
 
파이썬 웹프로그래밍 1탄
파이썬 웹프로그래밍 1탄 파이썬 웹프로그래밍 1탄
파이썬 웹프로그래밍 1탄 SeongHyun Ahn
 
Web vulnerability seminar2
Web vulnerability seminar2Web vulnerability seminar2
Web vulnerability seminar2Sakuya Izayoi
 
자바 웹 개발 시작하기 (6주차 : 커뮤니티를 만들어보자!)
자바 웹 개발 시작하기 (6주차 : 커뮤니티를 만들어보자!)자바 웹 개발 시작하기 (6주차 : 커뮤니티를 만들어보자!)
자바 웹 개발 시작하기 (6주차 : 커뮤니티를 만들어보자!)DK Lee
 
20131217 html5
20131217 html520131217 html5
20131217 html5DK Lee
 
Laravel 로 배우는 서버사이드 #2
Laravel 로 배우는 서버사이드 #2Laravel 로 배우는 서버사이드 #2
Laravel 로 배우는 서버사이드 #2성일 한
 
Spring boot 공작소(1-4장)
Spring boot 공작소(1-4장)Spring boot 공작소(1-4장)
Spring boot 공작소(1-4장)Choonghyun Yang
 
진짜기초 Node.js
진짜기초 Node.js진짜기초 Node.js
진짜기초 Node.jsWoo Jin Kim
 
자바 웹 개발 시작하기 (9주차 : 프로젝트 구현 – 추가적인 뷰)
자바 웹 개발 시작하기 (9주차 : 프로젝트 구현 – 추가적인 뷰)자바 웹 개발 시작하기 (9주차 : 프로젝트 구현 – 추가적인 뷰)
자바 웹 개발 시작하기 (9주차 : 프로젝트 구현 – 추가적인 뷰)DK Lee
 
파이썬 데이터베이스 연결 1탄
파이썬 데이터베이스 연결 1탄파이썬 데이터베이스 연결 1탄
파이썬 데이터베이스 연결 1탄SeongHyun Ahn
 
Secrets of the JavaScript Ninja - Chapter 12. DOM modification
Secrets of the JavaScript Ninja - Chapter 12. DOM modificationSecrets of the JavaScript Ninja - Chapter 12. DOM modification
Secrets of the JavaScript Ninja - Chapter 12. DOM modificationHyuncheol Jeon
 
파이썬 데이터베이스 연결 2탄
파이썬 데이터베이스 연결 2탄파이썬 데이터베이스 연결 2탄
파이썬 데이터베이스 연결 2탄SeongHyun Ahn
 

Was ist angesagt? (20)

5-5. html5 connectivity
5-5. html5 connectivity5-5. html5 connectivity
5-5. html5 connectivity
 
5-3. html5 device access
5-3. html5 device access5-3. html5 device access
5-3. html5 device access
 
Web vulnerability seminar4
Web vulnerability seminar4Web vulnerability seminar4
Web vulnerability seminar4
 
Web vulnerability seminar3
Web vulnerability seminar3Web vulnerability seminar3
Web vulnerability seminar3
 
파이썬 웹 프로그래밍 2탄
파이썬 웹 프로그래밍 2탄 파이썬 웹 프로그래밍 2탄
파이썬 웹 프로그래밍 2탄
 
챗봇 시작해보기
챗봇 시작해보기챗봇 시작해보기
챗봇 시작해보기
 
파이썬 웹프로그래밍 1탄
파이썬 웹프로그래밍 1탄 파이썬 웹프로그래밍 1탄
파이썬 웹프로그래밍 1탄
 
Web vulnerability seminar2
Web vulnerability seminar2Web vulnerability seminar2
Web vulnerability seminar2
 
자바 웹 개발 시작하기 (6주차 : 커뮤니티를 만들어보자!)
자바 웹 개발 시작하기 (6주차 : 커뮤니티를 만들어보자!)자바 웹 개발 시작하기 (6주차 : 커뮤니티를 만들어보자!)
자바 웹 개발 시작하기 (6주차 : 커뮤니티를 만들어보자!)
 
20131217 html5
20131217 html520131217 html5
20131217 html5
 
Laravel 로 배우는 서버사이드 #2
Laravel 로 배우는 서버사이드 #2Laravel 로 배우는 서버사이드 #2
Laravel 로 배우는 서버사이드 #2
 
4-2. ajax
4-2. ajax4-2. ajax
4-2. ajax
 
Spring boot 공작소(1-4장)
Spring boot 공작소(1-4장)Spring boot 공작소(1-4장)
Spring boot 공작소(1-4장)
 
진짜기초 Node.js
진짜기초 Node.js진짜기초 Node.js
진짜기초 Node.js
 
MySQL과 PHP
MySQL과 PHPMySQL과 PHP
MySQL과 PHP
 
자바 웹 개발 시작하기 (9주차 : 프로젝트 구현 – 추가적인 뷰)
자바 웹 개발 시작하기 (9주차 : 프로젝트 구현 – 추가적인 뷰)자바 웹 개발 시작하기 (9주차 : 프로젝트 구현 – 추가적인 뷰)
자바 웹 개발 시작하기 (9주차 : 프로젝트 구현 – 추가적인 뷰)
 
파이썬 데이터베이스 연결 1탄
파이썬 데이터베이스 연결 1탄파이썬 데이터베이스 연결 1탄
파이썬 데이터베이스 연결 1탄
 
Secrets of the JavaScript Ninja - Chapter 12. DOM modification
Secrets of the JavaScript Ninja - Chapter 12. DOM modificationSecrets of the JavaScript Ninja - Chapter 12. DOM modification
Secrets of the JavaScript Ninja - Chapter 12. DOM modification
 
Node.js 심화과정
Node.js 심화과정Node.js 심화과정
Node.js 심화과정
 
파이썬 데이터베이스 연결 2탄
파이썬 데이터베이스 연결 2탄파이썬 데이터베이스 연결 2탄
파이썬 데이터베이스 연결 2탄
 

Andere mochten auch

Comics and health education un’opportunità per promuovere la salute
Comics and health education  un’opportunità per promuovere la salute Comics and health education  un’opportunità per promuovere la salute
Comics and health education un’opportunità per promuovere la salute Giuseppe Fattori
 
Social network e sani stili di vita - Citizens included
Social network e sani stili di vita - Citizens includedSocial network e sani stili di vita - Citizens included
Social network e sani stili di vita - Citizens includedGiuseppe Fattori
 
Marketing sociale e comunicare salute. App & Game. Citizens included.
Marketing sociale e comunicare salute. App & Game. Citizens included.Marketing sociale e comunicare salute. App & Game. Citizens included.
Marketing sociale e comunicare salute. App & Game. Citizens included.Giuseppe Fattori
 
Facebook for public health - NPIN
Facebook for public health - NPINFacebook for public health - NPIN
Facebook for public health - NPINGiuseppe Fattori
 
Use of social media in health promotion: purposes, key performance indicators...
Use of social media in health promotion: purposes, key performance indicators...Use of social media in health promotion: purposes, key performance indicators...
Use of social media in health promotion: purposes, key performance indicators...Giuseppe Fattori
 
#eHealthPromotion: verso la salute "Patient included"
#eHealthPromotion: verso la salute "Patient included"#eHealthPromotion: verso la salute "Patient included"
#eHealthPromotion: verso la salute "Patient included"Giuseppe Fattori
 
Web 2.0 for health promotion reviewing the current evidence
Web 2.0 for health promotion  reviewing the current evidenceWeb 2.0 for health promotion  reviewing the current evidence
Web 2.0 for health promotion reviewing the current evidenceGiuseppe Fattori
 
Spotted Eagle Owl's House step by-step assembly
Spotted Eagle Owl's House step by-step assemblySpotted Eagle Owl's House step by-step assembly
Spotted Eagle Owl's House step by-step assemblyOwlsHouse
 

Andere mochten auch (11)

Ict in elt
Ict in eltIct in elt
Ict in elt
 
Comics and health education un’opportunità per promuovere la salute
Comics and health education  un’opportunità per promuovere la salute Comics and health education  un’opportunità per promuovere la salute
Comics and health education un’opportunità per promuovere la salute
 
Social network e sani stili di vita - Citizens included
Social network e sani stili di vita - Citizens includedSocial network e sani stili di vita - Citizens included
Social network e sani stili di vita - Citizens included
 
Marketing sociale e comunicare salute. App & Game. Citizens included.
Marketing sociale e comunicare salute. App & Game. Citizens included.Marketing sociale e comunicare salute. App & Game. Citizens included.
Marketing sociale e comunicare salute. App & Game. Citizens included.
 
Facebook for public health - NPIN
Facebook for public health - NPINFacebook for public health - NPIN
Facebook for public health - NPIN
 
Use of social media in health promotion: purposes, key performance indicators...
Use of social media in health promotion: purposes, key performance indicators...Use of social media in health promotion: purposes, key performance indicators...
Use of social media in health promotion: purposes, key performance indicators...
 
#eHealthPromotion: verso la salute "Patient included"
#eHealthPromotion: verso la salute "Patient included"#eHealthPromotion: verso la salute "Patient included"
#eHealthPromotion: verso la salute "Patient included"
 
Web 2.0 for health promotion reviewing the current evidence
Web 2.0 for health promotion  reviewing the current evidenceWeb 2.0 for health promotion  reviewing the current evidence
Web 2.0 for health promotion reviewing the current evidence
 
A-Z Resource
A-Z ResourceA-Z Resource
A-Z Resource
 
Spotted Eagle Owl's House step by-step assembly
Spotted Eagle Owl's House step by-step assemblySpotted Eagle Owl's House step by-step assembly
Spotted Eagle Owl's House step by-step assembly
 
Affordable Homeownership: CRA Conference Presentation
Affordable Homeownership: CRA Conference PresentationAffordable Homeownership: CRA Conference Presentation
Affordable Homeownership: CRA Conference Presentation
 

Ähnlich wie vine webdev

Angular2 router&http
Angular2 router&httpAngular2 router&http
Angular2 router&httpDong Jun Kwon
 
Node.js and react
Node.js and reactNode.js and react
Node.js and reactHyungKuIm
 
Ksug 세미나 (윤성준) (20121208)
Ksug 세미나 (윤성준) (20121208)Ksug 세미나 (윤성준) (20121208)
Ksug 세미나 (윤성준) (20121208)Sungjoon Yoon
 
#22.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...
#22.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...#22.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...
#22.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...탑크리에듀(구로디지털단지역3번출구 2분거리)
 
자바스크립트 프레임워크 살펴보기
자바스크립트 프레임워크 살펴보기자바스크립트 프레임워크 살펴보기
자바스크립트 프레임워크 살펴보기Jeado Ko
 
Xe3.0 frontend validator
Xe3.0 frontend validatorXe3.0 frontend validator
Xe3.0 frontend validator승훈 오
 
overview of spring4
overview of spring4overview of spring4
overview of spring4Arawn Park
 
Front-end Development Process - 어디까지 개선할 수 있나
Front-end Development Process - 어디까지 개선할 수 있나Front-end Development Process - 어디까지 개선할 수 있나
Front-end Development Process - 어디까지 개선할 수 있나JeongHun Byeon
 
[오픈소스컨설팅] Atlassian webinar 기본 트러블슈팅(1 of 2)
[오픈소스컨설팅] Atlassian webinar 기본 트러블슈팅(1 of 2)[오픈소스컨설팅] Atlassian webinar 기본 트러블슈팅(1 of 2)
[오픈소스컨설팅] Atlassian webinar 기본 트러블슈팅(1 of 2)Osc Osc
 
자바 웹 개발 시작하기 (7주차 : 국제화, 확인검증, 예외처리)
자바 웹 개발 시작하기 (7주차 : 국제화, 확인검증, 예외처리)자바 웹 개발 시작하기 (7주차 : 국제화, 확인검증, 예외처리)
자바 웹 개발 시작하기 (7주차 : 국제화, 확인검증, 예외처리)DK Lee
 
[Study]HeadFirst JSP&servlet chapter5
[Study]HeadFirst JSP&servlet chapter5[Study]HeadFirst JSP&servlet chapter5
[Study]HeadFirst JSP&servlet chapter5Hyeonseok Yang
 
#33.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...
#33.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...#33.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...
#33.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...탑크리에듀(구로디지털단지역3번출구 2분거리)
 
#32.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...
#32.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...#32.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...
#32.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...탑크리에듀(구로디지털단지역3번출구 2분거리)
 

Ähnlich wie vine webdev (20)

4-3. jquery
4-3. jquery4-3. jquery
4-3. jquery
 
Nodejs express
Nodejs expressNodejs express
Nodejs express
 
Angular2 router&http
Angular2 router&httpAngular2 router&http
Angular2 router&http
 
Node.js and react
Node.js and reactNode.js and react
Node.js and react
 
Ksug 세미나 (윤성준) (20121208)
Ksug 세미나 (윤성준) (20121208)Ksug 세미나 (윤성준) (20121208)
Ksug 세미나 (윤성준) (20121208)
 
#22.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...
#22.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...#22.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...
#22.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...
 
Spring boot actuator
Spring boot   actuatorSpring boot   actuator
Spring boot actuator
 
One-day-codelab
One-day-codelabOne-day-codelab
One-day-codelab
 
자바스크립트 프레임워크 살펴보기
자바스크립트 프레임워크 살펴보기자바스크립트 프레임워크 살펴보기
자바스크립트 프레임워크 살펴보기
 
Html5 performance
Html5 performanceHtml5 performance
Html5 performance
 
스프링 3.0 & RESTful
스프링 3.0 & RESTful스프링 3.0 & RESTful
스프링 3.0 & RESTful
 
Xe3.0 frontend validator
Xe3.0 frontend validatorXe3.0 frontend validator
Xe3.0 frontend validator
 
overview of spring4
overview of spring4overview of spring4
overview of spring4
 
Front-end Development Process - 어디까지 개선할 수 있나
Front-end Development Process - 어디까지 개선할 수 있나Front-end Development Process - 어디까지 개선할 수 있나
Front-end Development Process - 어디까지 개선할 수 있나
 
[오픈소스컨설팅] Atlassian webinar 기본 트러블슈팅(1 of 2)
[오픈소스컨설팅] Atlassian webinar 기본 트러블슈팅(1 of 2)[오픈소스컨설팅] Atlassian webinar 기본 트러블슈팅(1 of 2)
[오픈소스컨설팅] Atlassian webinar 기본 트러블슈팅(1 of 2)
 
자바 웹 개발 시작하기 (7주차 : 국제화, 확인검증, 예외처리)
자바 웹 개발 시작하기 (7주차 : 국제화, 확인검증, 예외처리)자바 웹 개발 시작하기 (7주차 : 국제화, 확인검증, 예외처리)
자바 웹 개발 시작하기 (7주차 : 국제화, 확인검증, 예외처리)
 
[Study]HeadFirst JSP&servlet chapter5
[Study]HeadFirst JSP&servlet chapter5[Study]HeadFirst JSP&servlet chapter5
[Study]HeadFirst JSP&servlet chapter5
 
Hacosa jquery 1th
Hacosa jquery 1thHacosa jquery 1th
Hacosa jquery 1th
 
#33.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...
#33.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...#33.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...
#33.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...
 
#32.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...
#32.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...#32.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...
#32.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...
 

Kürzlich hochgeladen

MOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution DetectionMOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution DetectionKim Daeun
 
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...Kim Daeun
 
캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차캐드앤그래픽스
 
A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)Tae Young Lee
 
Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)Wonjun Hwang
 
Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)Wonjun Hwang
 

Kürzlich hochgeladen (6)

MOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution DetectionMOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution Detection
 
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
 
캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차
 
A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)
 
Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)
 
Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)
 

vine webdev

  • 2. - 현재 WAP 구성 형태 순차적으로 처리 - Action 또는 View마다 하나의 자원(JSP)이 필요 - Static Method를 주로 사용
  • 3. HTML 코드를 재사용 스크립틀렛을 줄이고 간략히 표현 - Client 요청을 처리하는 객체를 ServletController로 단일화 - Model -> Data Object , Controller -> Servlet, View -> JSP 값을 가져오는 형태 String name = request.getParameter(“name”); 값을 Request에 저장하는 형태 MemberDTO dto = new MemberDTO(); request.setAttribute(“dto”, dto);
  • 4. CUSTOM TAG 예) 테이블 목록 <address mode=”list”/> 등으로 사용가능 1. <%@ page import="package.classFile" %> 2. <%@ taglib uri="/WEB-INF/taglib.tld" prefix="honey" %> <honey:printName /> 예) 프로필 사용 <profile id=”desk”/> 등으로 사용가능
  • 5. SERVLET & DISPATCHER public class MyServlet extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String name = request.getParameter(“name”); Member name = new Member(name); ....... 처리 ....... request.setAttribute("result", member); ServletContext sc = getServletContext(); RequestDispatcher rd = sc.getRequestDispatcher("/view.jsp"); rd.forward(request, response); 또는 rd.include(request, response); } 1. JSP를 View로 사용하고 (JSP는 Servlet에서 생성한 결과만 출력하는 기능) } 2. Servlet내에 doGet, doPost (각각 get, post 메소드를 처리) 내에서 비지니스 로직을 처리 3. 응답은 request, session등 상황에 맞는 저장소에 저장 4. 페이지 제어권 용도에 따라서 forward, include를 통해 View로 결과 보냄
  • 6. FILTER Web어플리케이션 전반에 영향을 끼치는 모듈 클래스 작성 public interface Filter {    public abstract void init(FilterConfig filterconfig) throws ServletException;    public abstract void doFilter(ServletRequest servletrequest, ServletResponse servletresponse, FilterChain filterchain)          throws IOException, ServletException;    public abstract void destroy(); } 모든 URL에 필터적용 <filter-mapping> SetCharacterEncdoin       <filter-name>SetCharacterEncodingFilter</filter-name>       <url-pattern>/*</url-pattern> gFilter 를 적용함    </filter-mapping> 예) 동작하는 필터 예 ) public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,          ServletException {       if(request instanceof HttpServletRequest) {          HttpServletRequest httpRequest = (HttpServletRequest)request;  // class casting          HttpServletResponse httpResponse = (HttpServletResponse)response;  // class casting          String userAgent = httpRequest.getHeader("user-agent").toUpperCase();      }
  • 7. JSTL : The expression language 기존 코드 유형 <% %> 안에 작성하는 JSP <% if (user.getRole() == "member")) { %> <p>Welcome, member!</p> <% } else { %> 스크립트 코드들과 많은 <p>Welcome, guest!</p> <% } %> 양의 HTML로 복잡해지는 JSTL 코드의 작성을 쉽게 <jsp:setProperty name="user" property="timezonePref" value='<%= request.getParameter("timezone") %>'/> JSTL, 표현식 <c:out value="${user.firstName}"/> <c:set var="timezone" scope="session" value="CST"/> http://slog2.egloos.com/3581446
  • 8. 인증 실체 확인 : 로그인 <web-app xmlns="http://caucho.com/ns/resin" public class MyAuthenticator extends AbstractAuthenticator xmlns:resin="urn:java:com.caucho.resin"> { <-- Authentication mechanism --> private PasswordUser _user; <resin:BasicLogin/> public MyAuthenticator() <-- Role-based authorization --> { <resin:Allow url-pattern="/foo/*"> _user = new PasswordUser("harry", "quidditch", <resin:IfUserInRole role="user"/> new String[] { "user" }); </resin:Allow> } <-- The authenticator --> public PasswordUser getUser(String userName) <resin:DatabaseAuthenticator'> { <resin:data-source>test</resin:data-source> if (userName.equals(_user.getName())) <resin:password-query> return _user; SELECT password FROM login WHERE username=? else </resin:password-query> return null; <resin:cookie-auth-query> } SELECT username FROM LOGIN WHERE cookie=? } </resin:cookie-auth-query> <resin:cookie-auth-update> UPDATE LOGIN SET cookie=? WHERE username=? 예) 사용자 인증 코드 </resin:cookie-auth-update> <resin:role-query> SELECT role FROM LOGIN WHERE username=? <web-app xmlns="http://caucho.com/ns/resin" </resin:role-query> xmlns:resin="urn:java:com.caucho.resin"> </resin:DatabaseAuthenticator> ... </web-app> <resin:XmlAuthenticator password-digest="none"> <resin:user name="Harry Potter" password="quidditch" group= 사용자 인증에 대한 내 <resin:user name="Draco Malfoy" password="pureblood" group= </resin:XmlAuthenticator> ... 용을 web.xml에 설정 </web-app>
  • 9. 인가 자원에 대한 접근 권한 <web-app xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin"> <resin:BasicLogin/> <resin:Allow url-pattern="/foo/*"> <resin:IfUserInRole role="user"/> </resin:Allow> <resin:XmlAuthenticator> ... </resin:XmlAuthenticator> </web-app> <web-app xmlns="http://caucho.com/ns/resin" ... xmlns:resin="urn:java:com.caucho.resin"> <resin:Allow url-pattern="/webdav/*"> view에서 권한 <resin:IfUserInRole role='webdav'/> </resin:Allow> ... 에 따라 처리 </web-app> 인증, 권한에 대한 내용 을 코드가 아니라 web.xml에 설정
  • 10. RESTFUL 1. HTTP 프로토콜의 PUT, GET, POST, DELETE 등과 같은 Method를 의미 그대로 사용한다. 2. Resource에 대한 접근을 URI를 이용한다. 예) HTTP request가 REST 웹 서비스 GET /book HTTP/1.1 Host: www.jaso.co.kr Accept: application/xml 위의 HTTP request는 책 목록을 가져 오기 위한 요청입니다. 특정 책의 상세 정보를 요청하는 경우에는 다음과 같 이 할 수 있습니다. GET /book/isbn_0001 HTTP/1.1 Host: www.jaso.co.kr Accept: application/xml 특정 책 정보를 삭제하는 경우는 다음과 같습니다. DELETE /book/isbn_0001 HTTP/1.1 Host: www.jaso.co.kr Accept: application/xml

Hinweis der Redaktion

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n