differenceJSP and HTML, the most significant advantage is that the JSP can be written in Java code, but not in HTML. ---------------------------
Writing
<%! %>, which can declare a variable or method, note: The variables declared here are global
<%%> Compared to the method above, the local
<%=%>, used to output expressions to the browser, note: This expression cannot be followed by a semicolon
---------------------------------------------------
Three directives are defined in jsp2.0: page directive, include directive, taglib directive.
1. The most common thing we have seen about page directives is this:
<% @page contenttype= "text/html;charset=gb2312" import= "Java.util.Date"%>
Mainly used to: set the encoding, import the jar package
2. With regard to the include directive, which he used to introduce other JSP pages, the JSP engine translates two jsps into a servlet, so also called static ingestion
3. With regard to the TAGLIB directive, it is a prefix that defines a tag library and its custom tags. For example, the use of C:foreach used by us. Import the JSTL package first, then add this tag to the JSP: <%@ taglib prefix= "C" uri= "Http://java.sun.com/jsp/jstl/core"%> you can use C:foreach
How to write Java code in JSP