Quiz Number 11
SWE 432, Fall 2009
November 19
- What is the motivation for JSP over Java Servlets?
Answer:
The motivation is separation of html presentation from program logic.
- Describe what the JSP container does with a JSP page.
You should distinguish the "first" time the container "sees"
a JSP page from later accesses to the JSP page.
Answer:
On the first visit
the JSP container generates and compiles a corresponding
Java Servlet.
On subsequent visits, the JSP container simply forwards
the request to the already-compiled servlet.
- What is a (Java) Bean?
Answer:
A Bean is a simple Java class that wraps one or more data values.
Beans need getters and (possibly) setters
to access values.
(Naming conventions for Beans mean that calls to the
appropriate Bean can be automatically generated,
e.g. from JSP properties.
A Bean must also be public and have a zero-arg constructor,
but these facts are not required for grading.
Instead, grading is based on having basically the right notion of a
Bean.)