Overview, Architecture, and Lifecycle of JSP Flashcards
1
Q
JSP
A
Java Server Pages
- a technology that is used to develop dynamic web pages by inserting Java code into the HTML pages (by making special JSP tags).
- a server-side programming technology that enables the creation of a dynamic, platform-independent method for building a web-based application
- a dynamic web technology based on servlet container and Java EE specification
2
Q
JSP vs JavaScript
A
JavaScript can generate HTML dynamically on the client but hardly interact with the webserver to perform complex tasks like database access and image processing etc.
3
Q
JSP container
A
- JSP engine to process JSP pages
- it provides the runtime environment and other services a JSP needs
4
Q
JSP Processing
A
- a browser sends an HTTP request
- the web server recognizes it is for a JSP page and forwards it to a JSP engine (.jsp vs .html)
- the JSP engine loads the JSP page and converts it into a servlet content (demo.jsp -> demo_jsp.java)
- the JSP engine compiles the servlet into an executable class (demo_jsp.class) and forwards it to a servlet engine
- the servlet engine loads the servlet class and executes it. The output is passed on to the webserver
- the webserver forwards the HTTP response to the browser
- the browser handles the HTML page inside the HTTP response.
5
Q
Java servlets
A
- Java programs that run on the Java-enabled webserver or application server
- they handle complex requests obtained from the webserver
6
Q
JSP lifecycle
A
the process from its creation until the destruction