java - Query on default page of Tomcat server -
this basic question understand.
i running fresh apache tomcat server on port 8080, , when type url http://localhost:8080
, see browser sends following request tomcat.
get / http/1.1 host: localhost:8080 connection: keep-alive cache-control: max-age=0 accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 user-agent: mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, gecko) chrome/35.0.1916.114 safari/537.36 accept-encoding: gzip,deflate,sdch accept-language: en-us,en;q=0.8
i see below http response content-type:text/html
my question:
1) how /
parameter of get
request mapped above html page response @ tomcat side, when tomcat server received get
request? below xml element in tomcat/conf/web.xml? flow on tomcat side after receiving request?
<!-- mapping default servlet --> <servlet-mapping> <servlet-name>default</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping>
tomcat architecture
a uml sequence diagram of request process flow understand it.
read more following sections directly official document of apache tomcat 7:
- overview - overview of tomcat server architecture key terms , concepts.
- server startup - detailed description, sequence diagrams, of how tomcat server starts up.
- request process flow - detailed description of how tomcat handles request.
it might understand url-pattern
servlet matching procedure
a request may match more 1 servlet-mapping in given context. servlet container uses straightforward matching procedure determine best match.
the matching procedure has four simple rules.
first, container prefers exact path match on wildcard path match.
second, container prefers match longest pattern.
third, container prefers path matches on filetype matches.
finally, pattern
<url-pattern>/</url-pattern>
matches request no other pattern matches.
have @ post how servlets filter identify next destination filter or servlet/jsp? detailed description understand visually.
Comments
Post a Comment