1.
Context = application
| - Config - Server.xml : WAS 설정 파일 호출, WAS 설정(속성)
| - Context.xml : Web Project 속성 설정 파일 ⓐworkDir설정 ⓑ DB연결 설정
| - web.xml : webpage 설정 파일(JSP url, Servlet 설정, encoding 등 7가지)
Session
|
Request
|
PageContext
| |
JSP java=servlet
2.
Interface ServletContext
public interface ServletContext
Defines a set of methods that a servlet uses to communicate with its servlet container, for example, to get the MIME type of a file, dispatch requests, or write to a log file.There is one context per "web application" per Java Virtual Machine. (A "web application" is a collection of servlets and content installed under a specific subset of the server's URL namespace such as
/catalog
and possibly installed via a.war
file.)In the case of a web application marked "distributed" in its deployment descriptor, there will be one context instance for each virtual machine. In this situation, the context cannot be used as a location to share global information (because the information won't be truly global). Use an external resource like a database instead.
The
ServletContext
object is contained within theServletConfig
object, which the Web server provides the servlet when the servlet is initialized.
3.
getAttribute, getAttributeNames()가 있으면 set도 있을 것 - 공통 method임
4.
주소 옮길 때는 getContextPath()를 이용해서 사용함
5.
Interface HttpServletRequest
- All Superinterfaces:
- ServletRequest
- All Known Implementing Classes:
- HttpServletRequestWrapper
6.
Interface HttpServletResponse
- All Superinterfaces:
- ServletResponse
- All Known Implementing Classes:
- HttpServletResponseWrapper
7.
* 는 0개 이상
?는 0 or 1
1개 이상은 무조건 줘야 함
8.
다음과 같은 코드 출력시
9.
PrintWriter에 대한 설명
Class PrintWriter
- java.lang.Object
- java.io.Writer
- java.io.PrintWriter
- All Implemented Interfaces:
- Closeable, Flushable, Appendable, AutoCloseable
public class PrintWriter extends Writer
Prints formatted representations of objects to a text-output stream. This class implements all of the print methods found inPrintStream
. It does not contain methods for writing raw bytes, for which a program should use unencoded byte streams.Unlike the
PrintStream
class, if automatic flushing is enabled it will be done only when one of the println, printf, or format methods is invoked, rather than whenever a newline character happens to be output. These methods use the platform's own notion of line separator rather than the newline character.Methods in this class never throw I/O exceptions, although some of its constructors may. The client may inquire as to whether any errors have occurred by invoking
checkError()
.
10.
com.biz.MemberBiz
com.vo.Member
com.dao.MemberDao
common.JDBCTemplate
11.
Session에 객체를 많이 담아서 좋을 게 없다.
12.
JSP의 Forward는 다음과 같은 것이 가지고 있음
RequestDispatcher
13.
List<Member> all = (List<Member>)request.getAttribute("my_all"); //getAttribute의 return은 Object이기 때문에 List<Member>로 형변환
'국비교육' 카테고리의 다른 글
국비교육 50일차 (0) | 2019.02.14 |
---|---|
2월 13일 국비교육 50일차 (0) | 2019.02.13 |
2월 11일 국비교육 48일 (0) | 2019.02.11 |
2월 1일 국비교육 (0) | 2019.02.01 |
1월 31일 국비교육 (0) | 2019.01.31 |
댓글