JEE Flashcards
Describe a servlet
A servlet is a small java program that runs inside a web server
Describe GenericServlet
GenericServlet is a protocol-indepent Servlet which contains the service method, with other helper methods that log and gather information about the application and servlet configuration
Describe the Servlet interface
The Servlet is a simple interface that contains methods for initializing and destroying the Servlet, as well as servicing requests
Describe two ways in which request parameters come
- Query parameters, also known as URI parameters e.g. GET /index.jsp?productId = 45845545&category=Books
- or multipart/form data
e.g POST /index.jsp?returnTo=product page
Host : www.example.com
Content-Length: 48
Content-type: application/x-www-form-urlencoded
doDelete() is responsible for _
doDelete() is responsible for deleting the resource at the specified URL
doGet() is responsible for _
doGet() is responsible for retrieving the resource at the specified URL
doHead() is responsible for _
doHead() is responsible for retrieving the resource at the specified URL, but only headers are returned
doOptions() returns _
doOptions() returns which HTTP methods are allowed
doPost() is typically used for _
doPost() is typically used for web form submission
doPut() _
doPut() stores the supplied entity at the URL
doTrace() is used for _
doTrace() is responsible for diagnostic purposes
For responding to _ requests, the javax.servlet.http.HttpServlet _ GenericServlet, and implements the _ method to accept only HTTP requests
For responding to HTTP-specific requests, the javax.servlet.http.HttpServlet extends GenericServlet, and implements the service method to accept only HTTP request
How do you instruct tomcat to start the servlet immediately when the web application starts
you do this by configuring the web.xml with the following:
1
The _ interface is an extension of ServletRequest that provides additional _ information about a received request.
The HttpServletRequest interface is an extension of ServletRequest that provides additional HTTP protocol-specific information about a received request. It specifies dozens of methods that can be used to obtain details about an HTTP request, eg HttpServletRequest request.getContextPath();
True or False, as of Java EE7, the only Servlet protocol currently supported is HTTP
True