當客戶想在通訊錄中新增新地址,或者編輯現有的地址資訊, 可選取 AddressBookForm.jsp 中的「新增地址」或「更新地址」, 此時即會載入 AddressForm.jsp。如果客戶選取「新增地址」,則會載入一份空白套表,讓其建立新記錄。如果客戶選取「更新地址」, 表示要更新現有地址, 此時會載入 AddressForm.jsp, 且 AddressDataBean 會從資料庫中擷取現有的地址資訊(位於適當的套表欄位中)。
內容檔
以下是供 AddressForm.jsp 檔使用的內容檔:
範例的所有內容檔皆位於下列目錄中:
drive:\WebSphere\CommerceServer\samples\Properties
drive:\Program
Files\WebSphere\CommerceServer\samples\Properties
/usr/WebSphere/CommerceServer/samples/Properties
/opt/WebSphere/CommerceServer/samples/Properties
/QIBM/ProdData/WebCommerce/samples/Properties
類別
AddressForm.jsp 會匯入下列類別:
<%@ page import="javax.servlet.*" %>
<%@ page import="java.util.*" %>
<%@ page import="com.ibm.commerce.command.*" %>
<%@ page import="com.ibm.commerce.server.*" %>
<%@ page import="com.ibm.commerce.beans.*" %>
<%@ page import="com.ibm.commerce.common.beans.*"
%>
<%@ page import="com.ibm.commerce.user.beans.*" %>
<%@ page import="com.ibm.commerce.user.objects.*"
%>
<%@ page import="com.ibm.commerce.datatype.*" %>
<%@ page import="com.ibm.commerce.usermanagement.commands.ECUserConstants"
%>
指令
AddressForm.jsp 所用的指令如下:
Bean
AddressForm.jsp 採用的 Bean 如下:
施行細節
產生的 HTML 輸出
以下檔案是針對此 JSP 頁面產生的 HTML 輸出範例:
在運作的系統中,這些頁面不會儲存成 HTML 檔, 不過可應要求以「檢視」指令產生。在本範例中, 檢視指令的名稱為 AddressForm。此指令用於 AddressBookForm.jsp 頁面中,以呼叫此頁。
針對本範例產生的 HTML 輸出檔位於下列目錄中:
drive:\WebSphere\CommerceServer\samples\web\Registration
drive:\Program
Files\WebSphere\CommerceServer\samples\web\Registration
/usr/WebSphere/CommerceServer/samples/web/Registration
/opt/WebSphere/CommerceServer/samples/web/Registration
/QIBM/ProdData/WebCommerce/samples/web/Registration
![]() |