Introduction to JSP
Java Server Page, is a Java page running on the server side, a dynamic Web page technical standards. The actual nesting of Java scripting languages is in HTML.
JSP syntax page directive: Defines the global attributes in a JSP file by setting multiple properties inside it. Syntax for the page directive:
<%@ page language= "java" import= "property value" contenttype= "text/html; Charset=utf-8"
pageencoding= "UTF-8"%>
The Language property is used to specify the language used by the JSP, which defaults to Java
The Import property is used to refer to the class used in the scripting language
The ContentType property is used to specify the MIME type of the page-generated content
CharSet the encoding format for sending content to the client browser.
pageencoding The encoding format of the JSP script content.
JSP%> nested Java scripting language through <% Java code
jsp Comments:
HTML comment:<!--Html-->, the content of this comment can be seen in the way the browser views the source code
JSP Comment: <%--jsp comment--> the content of the comment is not visible in the browser by viewing the source code
JSP script Comment: <%//single line comment%> <%/* Multiline comment */%>
the output of the JSP displays
display output of 1.out objects: the effect of out objects outputting data to the client
Common method: Out.printin () displays the page output and adds a newline at the end of the display.
Out.print () is displayed to the page output.
JSP (Java Server Page)