Servlet Introduction
Servlet Introduction
Servlet classes
public ServletConfig
getServletConfig()
The implementation of
init(ServletConfig config)calls
init()method)
HTT(Servlet
Session .onfiuration
4rror (aes
.reate a folder)
(laced>
http=66localhost=BCBC6slide;ex;
6index.ht#l
!r si#pl"
http=66localhost=BCBC6slide;ex;
Server name
!efault protocol #here tomcat runs
protocol
$older name
According to j2ee
specs, war file has to
be created. For
tomcat we dont do
so. So, does this
mean that tomcat
does not strictly
follow j2ee specs.
Tomcat follows
j2ee specs! It jst
gi!es yo a simple
way to deploy yor
application.
Another option to
deploy wold be to
place the war file
in the webapps
folder!
Request and Response hierarchy
%ttpServletResponse
ServletResponse
%ttpServletRequest
ServletRequest
ServletRequest
DufferedReader getReader()
ServletnputStrea#
getnputStrea#()
int getContent,ength()
Enu#eration get(ara#eterEa#es()
StringFG get(ara#eterHalues(String
na#e)
E)ample ahead
%llo#s you to read ra# bytes
or characters from the stream
HttpServletRequest $nterface
String get0ethod()
Enu#eration get$eaderEa#es()
String getIuer"String()
Coo<iesFG getCoo<ies()
$ttpSession getSession()
/00P
protocol
specific
method
s
Later
ServletResponse $nterface
Servlet!utputStrea#
get!utputStrea#()
(rint3riter get3riter()
%llo#s us to #rite
into the response
stream
"e ha!e seen
this !
HttpServletResponse $nterface
void addCoo<ies(Coo<ie c)