三個腳本元素:
<%! int i=0> 聲明變量
<%=a+b%> 表達式
<%
if(){
}else{
}
%> 腳本段
三個指令元素:
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="..."%>
<%@ taglib uri=http://www.jspcentral.com/tags prefix="public"%>
8個動作指令:
頁面跳轉:
<jsp:forward page="">
頁面包含:
<jsp:param name="username" value="<%=username%>"/>
<jsp:param name="password" value="<%=password%>"/>
</jsp:forward>
<jsp:include page="" flush="true">
<jsp:include page="" flush="true">
<jsp:param name="username" vlaue="jsmith">
</jsp:include>
創建bean:
<jsp:useBean id="" scope="session" class="session.Carts"/>
<jsp:getProperty name="cart" property="*"/>
<jsp:useBean id="checking" scope="" class="">
<jsp:setProperty name="checking" property="balance" value="0.0">
</jsp:useBean>