[MUSIC] The Java technology that's used to handle incoming requests on a server, is typically Servlets. So what Servlets do, is when a browser, where in our case a mobile device, sends an HTTP request. [BLANK_AUDIO] This request gets routed to what's called a Web Application Container. So this is often just called a Web Container, and inside of the web container, there are one or more Servlets that handle and process the HTTP requests that are being sent to it. So the request will reach the web container and then be routed to one of many individual Servlets typically, that are running inside of that web container. Now, what a Servlet is, is it's just a Java object, that has special methods for handling incoming HTTP requests. And the key methods that a servlet has, are doGet, doPost, and you can probably see a pattern here. You have do methods for the various request methods, that are part of the HTTP specification. So this Servelet is nothing more than a Java object, that inherits from Servlet and has implementations of the various request handling methods, that correspond to the various HTTP request method. So if somebody sends a Get request for some resource like Foo, it's going to pick out a Servlet, it's going to route that request to the Servlets doGet method and then that doGet method gets access to all of the different pieces of the request. Namely, the request line where we can look at for example, the resource that was requested, it gets access to the Headers and it gets access to the request body, so they can go and do any processing associated with that request. So, Servlets are the underline and most commonly used technology in Java, for handling the incoming request. Now, one of the key questions is, if we have multiple Servlets here, how do we decide which Servlet should handle a particular HTTP request? Well, inside of most web containers, there's what we call basically a routing function, or some router which decides based on the request that's coming in, which Servlet should handle it. And in Java, the way that Servlet handling and routing is specified, is through a web.xml file. And this is a specialized file that tells the web container when a particular request comes in, so let's say we get a new request here for slash-bar and it's a post to bar, it looks in the web.xml file, finds the Servlet that it should go to, and then routes the request to the appropriate Servelet, based on what's specified in that web.xml file. So this is essentially the routing of requests. This is where routing is specified as in web.xml. The web container handles the life cycle, and uses this routing table to decide which Servlet should receive requests, and then the individual Servlet's process request. [BLANK_AUDIO] So, this is the overview of how the Servlet system in, in Java works, to handle requests.