JSP is a Web page technical standard advocated by Sun company. In the HTML file, the addition of Java code constitutes a JSP Web page, when the WEB server to access the JSP request, the first execution of the Java Program source code, and then returned in HTML form, Java program run on the server, the final display on the client. JSP originates from Java, so the JSP environment depends on the JDK, and of course the server software (such as TOMCAT, etc.).
First, the operating environment to build
1. To install the JDK, please refer to the previous blog post:Java learning -001-jdk installation configuration
2. Tomcat deployment and environment variable configuration, see previous blog post:java Learning -032-javaweb_001-tomcat environment deployment and basic configuration
Second, the basic syntax of JSP
In addition to HTML tags, JSP has 4 elements that are needed to build Web content, as follows:
Directive (Directive)
Statement (Declaration)
Source Code (Scriptlet)
Expressions (expression)
JSP directives are used to set the related properties of the entire JSP page, such as the page scripting language, the Java package name and the page encoding character set that need to be imported, and the syntax format of the JSP Directive: <%@ directive Name attribute = "Value"%>. JSP directives include: page, include, taglib 3 instructions.
The format of the declared property is as follows:
<%! String JSP = "DECLARE attribute format";%>
The format of the declaring method is as follows:
<%! Void Jsp_method {};%>
JSP and HTML code are separated by <%......%>, and the format of the JSP language is as follows:
<% Java Source code%>
Third, JSP annotation method
Show comments: The format of the display comments embedded in the JSP page is as follows:
<!--show comments--
Implicit comments: The format for embedding implicit annotations on a JSP page is as follows:
<%!--Implicit annotation--%>
At this point, Java Learning -033-javaweb_002-Web Markup Language JSP basic knowledge of the smooth end, I hope this article can give beginners javaweb you a reference.
Finally, very grateful to the pro-stop, I hope this article can be pro helpful. Warmly welcome the kiss to discuss together and progress together. Thank you so much! ^_^
Java Learning -033-javaweb_002--The basic knowledge of Web Markup Language JSP