Java Interview Guide: How to Build Confidence With a Solid Understanding of Core Java Principles pdfdrive com



Yüklə 0,53 Mb.
Pdf görüntüsü
səhifə23/47
tarix06.05.2023
ölçüsü0,53 Mb.
#108601
1   ...   19   20   21   22   23   24   25   26   ...   47
Java Interview Guide

JavaServer Pages
Servlets
are notoriously clumsy at constructing HTML documents through
Java code. JavaServer Pages (JSP) are text documents that contain static and
dynamic content through the use of tags and a unified expression language (EL).
JSPs are compiled into Servlets and have implicit access to the request and
response objects.
Servlets
and JSPs frequently work together through
a RequestDispatcher. A RequestDispatcher transfers control
of a request from one resource to another. For example, a servlet typically
handles the logic for a request and delegates to a JSP to render the response.


Filters
Filters
intercept servlet requests to provide cross-cutting functionality.
For example, a security filter could redirect unauthenticated users to a login
page. Filters are mapped to URL patterns in the deployment descriptor.


Model-View-Controller
Model-view-controller (MVC) is a design pattern that encourages the separation
of concerns in a web application. The model represents domain objects, such as
data retrieved from a database. The view is a visualization of the model, such as
a JSP that constructs an HTML document. The controller facilitates changes
to the model, such as a Servlet that handles the submission of a form.
Multiple frameworks exist to facilitate the MVC pattern, such as Spring MVC.


Questions
What is a servlet container?
What is a web application?
What is a WAR file?
What is a web.xml file?
What is the difference between a Servlet and an HttpServlet?
What is the difference between a Servlet and a JSP?
What is a servlet filter?
What is the model-view-controller pattern?



Yüklə 0,53 Mb.

Dostları ilə paylaş:
1   ...   19   20   21   22   23   24   25   26   ...   47




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin