Servlets Flashcards
Explain the purpose of the urlPatterns annotation as found in servlets, for
example:
@WebServlet (name = “dataServlet”, urlPatterns = {“/dataServlet”})
The name variable can be referenced as the ACTION from HTML forms easily to send data to the servlet for example
urlPatterns is a mapping of the requested URL to the servlet controller.
When a client navigates to a certain part of a website it will be pattern matched to this servlet.
Explain the difference between request scope, session scope and application
scope in JEE applications.
Application scope lasts from the point the web app is first started on the server until it is shut down or restarted.
Request scope lasts from when a request is first made to a servlet and lasts until it delivers a response.
Session scope lasts from when a client i.e. web browser is first opened unitl it is closed.