?JSP (Java Server Pages) refers to the following:? Embed the Java scripting language in HTML? Compile and execute embedded Java scripting language commands by the JSP engine in the application server? Then returns the entire page information generated to the client
Page Composition?
JSP directives directive function:
Control the overall structure of the servlet generated by this page
? general form of instruction:
<%@ directive {attr= "value"}%>
? directive instruction Category
1. Page directive
Role: Indicates the information related to the page.
2.include instruction
Role: Contains another file to enable reuse of the page.
3.taglib instruction
Function: Indicates the tag library used by this JSP page.
page directive
Role: Indicates the information related to the page.
Note: In a JSP page, the page directive can appear more than once, but each property can only appear once, and the repeating property setting overrides the previous setting, but the Import property is an exception and can have multiple import operations.
Basic syntax Format:
<%@ page Page_directive_attr_list%>
Page directive Common Properties
include instruction
function : include another file (html,jsp,text , etc. ) , the contents of the file
included in this JSP in the page
Syntax :<%@ include file= "top.jsp "%>
taglib instruction
function : Indicates this jsp syntax : <%@ taglib uri= "Taglibraryuri" prefix= "TagPrefix"%>
Property |
description |
Language= "Java" |
languagevariable tellsServerwhich language will be used in the file,JSPin the current specification,Javais aJSPthe only supported language |
extends= "Package.class" |
extendsvariable defines theJSPPage generated byservletin general, this attribute is used very little. |
Import= "Package.*,package.class" |
Importvariable and any oneJavathe first part of the program. Importthe value of a variable is a series of comma-separated lists that indicate the packages and classes that you want to introduce. |
JSP pages and simple instructions