JSP page elements:
---- Static part ----- HTML static text
---- Command ----------- starts with "<% @" and ends with "%>"
---- Expression -------- <% = Java expression %>
---- Script ----------- <% Java code %>
---- Declare ----------- <%! Function or method %>
---- Action ----------- start with "<JSP: Action name" and end with "<JSP: Action Name>"
---- Comment ----------- <! -- Annotation: the client can see -->, <% -- Annotation, and the client cannot see -- %>
JSP notes:
<! -- Comment content --> HTML comment
<% // Comment content %> JSP normal comment
<%/* Comment content */%> JSP normal comment
<% -- Comment content -- %> JSP hide comment
Script element:
<% = (1 + 2) %> JSP expression, which cannot end with a semicolon.
<% Date = new date (); Out. println (date. gethours (); %> JSP script
<%! Int I = 0; void count () {I ++ ;}%> <%! Public class peaple {private string name; Public getname () {return name ;}%> JSP Declaration (variables, methods, classes)
Command element:
<% @ Page [Language = "Java"] [contenttype = "text/html; charset = ISO-8859-1"] [method = "dopost"] [inport = "Java. io. *, Java. util. hashtable "] [session =" true "] [errorpage =" error. JSP "] [iserrorpage =" true "] [buffer =" 24kb "] %>
Page command
<% @ Includ file = "url" %> include command
Action element:
<JSP: Include page = "admin/login. jsp"/> contains actions
<JSP: Forward page = "admin/login. jsp"/> Redirection
<JSP: Param mane = "parametername" value = "<% = STR %>"/> Pass Parameter commands
<JSP: plugin type = "bean | applet" code = "classfiledirectoryname" codebase = "classfiledirectoryname"/> execute the applet or bean tag