I. Introduction to JSP: Introduction to JSP
JSP stands for Java Server Pages. Like servle technology, JSP is a technology defined by SUN for developing dynamic web resources.
JSP is actually a Servlet.
The biggest feature of JSP technology is that writing jsp is like writing html, but compared with html, html can only provide static data for users, jsp technology allows you to nest java code on pages to provide dynamic data.
Both JSP and Servlet can be used to develop dynamic web resources. However, due to their respective characteristics, servlet is gradually used as a controller component in web applications in long-term software practices, JSP technology is used as a data display template.
The reason is that the program data is usually beautified before being output:
Making JSP generate dynamic data using java code and beautify it will make the page difficult to maintain.
Making servlet generate both data and embed html code inside to beautify data also results in poor program readability and difficulty in maintenance.
Therefore, the best way is to let these two technologies take responsibility for each of them. servlet is only responsible for responding to requests to generate data and bringing the data to jsp through forwarding technology, data Display jsp.
A JSP page is a common web page with JSP elements. It consists of static content and dynamic content.
Static is an HTML element.
The dynamic content includes command elements, script elements, Action elements, and comments.