본문 바로가기

Servlet & JSP

(4)
JSP에서 Database(MySQL) 연결이 안될 때 : JDBC 연결이 안될 때 간혹 mySQL에 있는 JDBC로는 인식이 안되는경우가 있다. 이럴 경우에는 프로젝트 라이브러리에 직접 복.붙하면 해결이 된다.
Servlet & JSP에서 Session 사용법 docs.oracle.com/javaee/7/api/javax/servlet/http/HttpSession.html HttpSession (Java(TM) EE 7 Specification APIs) Provides a way to identify a user across more than one page request or visit to a Web site and to store information about that user. The servlet container uses this interface to create a session between an HTTP client and an HTTP server. The session persis docs.oracle.com 세션 생성 개발자가 직접..
Servlet & JSP에서 Cookie 사용법 다음은 오라클에서 설명하는 Cookie 클래스이다. 읽어보면 도움이 되니 읽어보는 것을 추천한다! docs.oracle.com/javaee/7/api/javax/servlet/http/Cookie.html Cookie (Java(TM) EE 7 Specification APIs) Creates a cookie, a small amount of information sent by a servlet to a Web browser, saved by the browser, and later sent back to the server. A cookie's value can uniquely identify a client, so cookies are commonly used for session management..
Servlet에서 init()으로 객체를 받는 방법 과제를 풀던 도중 문제가 발생했다. 과제의 내용은 이렇다. 이전에 실습한 로그인 서블릿에 init-param 을 추가하여 변경 서블릿 초기 정보로 web.xml 에 adminID로 "admin", adminPwd 로 "12345"를 미리 지정한다. adminID 는 init() 메서드에서 불러오고, adminPwd 는 doget 에서 불러와서 로그인 프로세스 진행 내가 수정한 web.xml은 아래와 같다 - 중략 - query com.edu.test.QueryServlet adminID admin adminPwd 12345 query /query - 중략 - 서블릿 작업을 수행하기 위해 아래와 같이 코드를 수정했다. package com.edu.test; import java.io.IOException;..