본문 바로가기

web/JSP

[JSP] request, response, out

request

javax.servlet.http.HttpServletRequest request

Object getAttribute(String name)
	
Enumeration<String> getAttributeNames()
	
void removeAttribute(String name)
	
void setAttribute(String name, Object o)
	
	
String getParameter(String name)

Map<String, Strint[]> getParameterMap()

Enumeration<String> getParameterNames()

String[] getParameterValues(String name)



//기타

String getCharacterEncoding()
String getContentType()
String getLocalName()
int getLocalPort()
String getProtocol()
String getRemoteAddr()
String getRemoteHost()
int getRemotePort()
String getScheme()
String getServerName()
int getServerPort()
ServletContext getServletContext()
boolean isSecure()
String changeSessionId()
String getContextPath()
Cookie[] getcookies()
String getMethod()
StrinG getQueryString()
String getRemoteUser()
String getRequestURI()
StringBuffer getRequestURL()
String getServletPath()
HttpSession getSession()
HttpSession getSession(boolean create)
void login(String username, String password)
void logout()

Parameter는 Form을 통해 받은 정보 Attribute는 코드상 별도로 추가

 

 

 

 

 

response

javax.servlet.http.HttpServletResponse response

void addCookie(Cookie cookie)

void sendRedirect(String location)



//기타
void flushBuffer()
int getBufferSize()
String getCharacterEncoding()
String getContentType()
ServletOutputStream getOutputStream()
PrintWriter getWriter()
void reset()
void resetBuffer()
void setBufferSize(int size)
void setCharacterEncoding(String charset)

 

 

 

 

 

out

javax.servlet.jsp.jspWriter out

void clearBuffer()
int getBufferSize()
int getRemaining()
boolean isAutoFlush()
void newLine()
void print(boolean b)
void print(char c)
void print(char[] s)
void print(double d)
void print(float f)
void print(int i)
void print(long l)
void print(Object obj)
void print(String s)
void println()
void println(boolean x)
void println(char x)
void println(char[] x)
void println(double x)
void println(float x)
void println(int x)
void println(long x)
void println(Object x)
void println(String x)

Writer append(char c)
Writer append(CharSequence csq)
Writer append(CharSequence csq, int start, int end)
void close()
void flush()
void write(char[] cbuf)
void write(char[] cbuf, int off, int len)
void write(int c)
void write(String str)
void write(String str, int off, int len)

 

참고

docs.oracle.com/javaee/7/api/javax/servlet/http/HttpServletRequest.html

 

HttpServletRequest (Java(TM) EE 7 Specification APIs)

Validate the provided username and password in the password validation realm used by the web container login mechanism configured for the ServletContext. This method returns without throwing a ServletException when the login mechanism configured for the Se

docs.oracle.com

docs.oracle.com/javaee/7/api/javax/servlet/ServletRequest.html

 

ServletRequest (Java(TM) EE 7 Specification APIs)

Stores an attribute in this request. Attributes are reset between requests. This method is most often used in conjunction with RequestDispatcher. Attribute names should follow the same conventions as package names. Names beginning with java.*, javax.*, and

docs.oracle.com

docs.oracle.com/javaee/7/api/javax/servlet/ServletResponse.html

 

ServletResponse (Java(TM) EE 7 Specification APIs)

Defines an object to assist a servlet in sending a response to the client. The servlet container creates a ServletResponse object and passes it as an argument to the servlet's service method. To send binary data in a MIME body response, use the ServletOutp

docs.oracle.com

docs.oracle.com/javaee/7/api/javax/servlet/http/HttpServletResponse.html

 

HttpServletResponse (Java(TM) EE 7 Specification APIs)

Gets the values of the response header with the given name. This method considers only response headers set or added via setHeader(java.lang.String, java.lang.String), addHeader(java.lang.String, java.lang.String), setDateHeader(java.lang.String, long), ad

docs.oracle.com

docs.oracle.com/javase/7/docs/api/java/io/Writer.html?is-external=true

 

Writer (Java Platform SE 7 )

Flushes the stream. If the stream has saved any characters from the various write() methods in a buffer, write them immediately to their intended destination. Then, if that destination is another character or byte stream, flush it. Thus one flush() invocat

docs.oracle.com

docs.oracle.com/javaee/7/api/javax/servlet/jsp/JspWriter.html

 

JspWriter (Java(TM) EE 7 Specification APIs)

The actions and template data in a JSP page is written using the JspWriter object that is referenced by the implicit variable out which is initialized automatically using methods in the PageContext object. This abstract class emulates some of the functiona

docs.oracle.com