JSP Development Getting Started (2) - The Basic Principle of JSP Grammar

zhaozj2021-02-08  245

After installation, let's discuss the syntax of JSP. If you want to be lazy, you can download the symbol card and if you are not familiar with Java programming, you may want to refer to Sun's manual; however, website builders should not do Too many Java development. In addition to several functions, the Java program code appears on your JSP page should minimize it; remember this, let us first take a look at the JSP compiler guide and instruction components, then we JavaBeans and internal objects will be explained. The JSP compiler guidelines are five types of autographs. JSP 1.0, most JSPs are included in a single volume label included with <% as start%> as the end. New JSP 1.1 The specification has been published, and it is also compatible with XML. JSP compiler guide and instruction component compiler indicates that <% @ compiler indication%> Declaration <%! Declaration%> Expression <% = expression%> program code segment / Small Directive <% Program Code%> Note <% - Note -%> The compiler indicating that the JSP compiler indication is for the JSP engine. They don't directly produce any visible output; the opposite, they are telling the engine how other JSP pages are told. They are always included in the <% @%> volume. Two major guidelines are Page and Include. We will not discuss the Taglib compiler guide but it can be used in JSP1.1 to build a self-reservation. You can almost find the Page compiler instruction on all your JSP page. Although this is not a must, it allows you to specify where you can find the supported Java category: <% @ page import = "java.util.date"%>, when an event occurs when the Java problem occurs Where is the message transfer: <% @ Page ErrorPage = "ErrorPage.jsp"%>, and you are? Information for the user to manage the call period, you may access multiple web pages (more calls will be in JavaBeans later Discussion: <% @ page session = "true"%>. The Include compiler indicates that you divide your content into several manageable components, just like those web pages with headers or footnotes. The web page contained may be a fixed format HTML web page or a web page for JSP content: <% @ include file = "filename.jsp"%>. Declaration JSP declaration allows you to define the variables of the web level to store information or define the supported functions, allowing the rest of the JSP page to be used. If you find that you have too many program code, you'd better put them in different Java categories. You can find the declaration in <%!?%>. Remember to add a semicolon to the back of the variable declaration, just as any effective Java narrative form: <%! Int i = 0;%>. The expression JSP has an expression that evaluates the results of the expression to convert to a string and use it directly on the output web page. The JSP operation belongs to the <% =?%> Volume label, does not contain a semicolon, an unwanted part of the quotation number string. <% = I%> <% = "hello"%>. Program code segment / small instruction file JSP program code snippet or small instruction file is included in <%?%>. This Java program code will execute when the web server accepts this request.

转载请注明原文地址:https://www.9cbs.com/read-2087.html

New Post(0)