1--JSP small introduction

Jsp Brief Introduction
JSP (full name JavaServer Pages) is a dynamic web page technology standard led by Sun Microsystems. JSP is deployed on the web server, can respond to the request sent by the client, and dynamically generate HTML, XML or other format document Web pages according to the requested content, and then return it to the requester. JSP technology uses Java language as a scripting language to provide services for users' HTTP requests, and can handle complex business requirements together with other Java programs on the server.
JSP embeds Java code and specific variable content into static pages, and uses static pages as templates to dynamically generate part of the content. JSP introduces XML tags called "JSP Actions" to call built-in functions. In addition, you can create JSP tag libraries, and then use them like standard HTML or XML tags. Tag libraries can enhance functionality and server performance without being restricted by cross-platform issues. The JSP file will be converted into more primitive Servlet code by its compiler at runtime. The JSP compiler can compile the JSP file into a servlet written in Java code, and then the Java compiler can compile it into a binary machine code that can be executed quickly, or it can be directly compiled into a binary code.
Jsp annotations The annotations in
jsp support two types of annotations:

  1. The displayed comments, this kind of comment client allows to see the
    syntax: <!—The content of the comment—>
    is actually an HTML comment.
  2. Implicit note: the client cannot see it.
    1): Single-line comment: //Content of comment
    2): Multi-line comment: / Content of comment /
    3): Jsp's own comment: <%–Content of comment–%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html >
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>jsp注释</title>
</head>
<body>
	<div>jsp的注释讲解</div>
	<!-- 这是HTML标签的注释:显示的 -->
	<%
		//单行注释:隐藏的
		int num = 5;
	    /*多行注释
	            可以注释多行:隐藏的
	    **/
	%>
	num的值是:<%=num %>
	<%-- jsp自己的注释。隐藏的 --%>
</body>
</html>

Guess you like

Origin blog.csdn.net/qwy715229258163/article/details/113938145