question: should I remember all following methods to pass the exam? Those methods I copy from the note.
1.4.Identify the interface and method to access values and resources and to set object attributes within the following three Web scopes:
1.4.1.Request (Interfaces: ServletRequest and HttpServletRequest)
1.4.1.1.Enumeration ServletRequest.getAttributeNames() - returns empty enumeration if no attributes
1.4.1.2.Object ServletRequest.getAttribute(
String name) - returns null if does not exist
1.4.1.3.void setAttribute(String name, Object obj) - most often used in conjunction with RequestDispatcher; attrib names should follow same convention as pkg names
1.4.1.4.void removeAttribute(String name)
1.4.1.5.String ServletRequest.getCharacterEncoding() - returns encoding used in request body, or null if not specified
1.4.1.6.int ServletRequest.getContentLength() - returns length of request body or -1 if unknown
1.4.1.7.String ServletRequest.getContentType() - returns mime type of request body or null if unknown
1.4.1.8.String ServletRequest.getProtocol() - returns protocol/version, e.g. HTTP/1.1
1.4.1.9.String ServletRequest.getScheme() - scheme used to make this request, e.g. ftp, http, https
1.4.1.10.String ServletRequest.getServerName()
1.4.1.11.int ServletRequest.getServerPort()
1.4.1.12.String HttpServletRequest.getAuthType() - e.g. BASIC, SSL, or null if not protected
1.4.1.13.String HttpServletRequest.getContextPath() - e.g. �/myservlet�
1.4.1.14.String HttpServletRequest.getMethod() - e.g. GET, POST, HEAD, PUT
1.4.1.15.String HttpServletRequest.getPathInfo() - returns extra path info (string following
servlet path but preceding query string); null if does not exist
1.4.1.16.String HttpServletRequest.getPathTranslated() - translates extra path info to a real path on the server
1.4.1.17.String HttpServletRequest.getQueryString() - returns query string; null if does not exist
1.4.1.18.String HttpServletRequest.getRemoteUser() - returns null if user not authenticated
1.4.1.19.Principal HttpServletRequest.getUserPrincipal() - returns null if user not authenticated
1.4.1.20.String HttpServletRequest.getRequestURI() - e.g. if request is �POST /some/path.html HTTP/1.1�, then returns �/some/path.html�
1.4.1.21.String HttpServletRequest.getServletPath() - returns servlet path and name, but no extra path info
1.4.1.22.HttpSession HttpServletRequest.getSession(boolean create)
1.4.1.23.HttpSession HttpServletRequest.getSession() - calls getSession(true)
[This message has been edited by Win Yu (edited October 29, 2001).]
[This message has been edited by Win Yu (edited October 29, 2001).]