JSP/Servlet及相關技術詳解
阿新 • • 發佈:2017-08-19
script return 指令 o-c rip title info turn expires <meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
--> /*
定義一個方法
*/
public String info(){
return "hello";
}
%>
<body>
this is my test page !
<br>
<%=count++ %>
<%=info() %>
JSP聲明
<%!聲明部分%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>歡迎</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<%!
//聲明一個整數變量
public int count;
定義一個方法
*/
public String info(){
return "hello";
}
%>
<body>
this is my test page !
<br>
<%=count++ %>
<%=info() %>
</body>
</html>
輸出JSP表達式
<%=表達式%>
<%=count++ %>
<%=info() %>
替代out.println輸出語句,輸出表達式語法後不能有分號
JSP腳本
JSP的3個編譯指令
JSP腳本的9個內置對象
JSP/Servlet及相關技術詳解