?? changeshippingaddress.jsp
字號:
<%@ page contentType="text/html; charset=UTF-8" %>
<%--
* @author Sujatha
* @version 1.0
*
* Development Environment : Oracle9i JDeveloper
* Name of the Application : changeShippingAddress.jsp
* Creation/Modification History :
*
* Sujatha 27-Dec-2001 Created
* Sujatha 17-Jan-2003 Incorporated Struts framework
*
* Overview of Application
* This JSP displays the current user address where the order has to be
* shipped with an option to change the address.
*
--%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ page language="java" errorPage="../misc/errorHandler.jsp" %>
<%@ page import="oracle.otnsamples.vsm.actions.forms.ShippingAddressForm"%>
<%@ page import="java.util.TreeMap"%>
<HEAD>
<TITLE><bean:message key="title.shopcreation"/></TITLE>
<!-- To prevent caching -->
<%
response.setHeader("Cache-Control","no-cache"); // HTTP 1.1
response.setHeader("Pragma","no-cache"); // HTTP 1.0
response.setDateHeader ("Expires", -1); // Prevents caching at the proxy server
%>
<SCRIPT SRC="includes/utils.js"></SCRIPT>
<SCRIPT>
function submitForm() {
var frm = document.forms[1];
// Check if all the required fields have been entered by the user before
// submitting the form
if( trim(frm.address.value).length==0) {
alert("<bean:message key='address.javascript.addresserror'/>");
frm.address.focus();
return ;
}
if( frm.address.value.length > 100 ) {
alert("<bean:message key='address.javascript.addresslimiterror'/>");
frm.address.focus();
return ;
}
if( frm.city.value == "" ) {
alert("<bean:message key='address.javascript.cityerror'/>");
frm.city.focus();
return ;
}
if( frm.state.value == "" ) {
alert("<bean:message key='address.javascript.stateerror'/>");
frm.state.focus();
return ;
}
var zip = frm.zip.value;
if( zip == "" ) {
alert("<bean:message key='address.javascript.zipcodeerror'/>");
frm.zip.focus();
return ;
}
if( isNaN(zip) ) {
alert("<bean:message key='address.javascript.zipcodeformaterror'/>");
frm.zip.focus();
return ;
}
if( frm.phone.value == "" ) {
alert("<bean:message key='address.javascript.phoneerror'/>");
frm.phone.focus();
return ;
}
frm.submit();
}
</SCRIPT>
</HEAD>
<jsp:include page="../misc/userHeader.jsp" flush="true"></jsp:include>
<html:form action="authusershipaddress.do?command=changeAddress">
<%
ShippingAddressForm address = (ShippingAddressForm)request.getAttribute("address");
if(address == null)
address = new ShippingAddressForm();
%>
<TABLE width="100%">
<TR>
<TD width="25%" class="SubHeading" align="center"><bean:message key="subheading.changeaddress"/></TD>
<TD width="75%"><HR></TD>
</TR>
<logic:present name="messageKey" scope="request">
<TR>
<TD width="20%" align="center" class="ErrorText" colspan="2">
<%=request.getAttribute("message")%>
</TD>
</TR>
</logic:present>
</TABLE>
<BR>
<TABLE width="100%" border="0" cellspacing="0" cellpadding=
"3">
<TR>
<TD align="right" class="Prompt" width="40%"><bean:message key="prompt.address"/></TD>
<TD width="60%"> <html:textarea property="address" value="<%=address.getAddress()%>" rows="5" cols="35"/></TD>
</TR>
<TR>
<TD align="right" class="Prompt" width="40%"><bean:message key="prompt.city"/></TD>
<TD width="60%">
<html:text property="city" value="<%=address.getCity()%>" size="25" maxlength="20"/>
</TD>
</TR>
<TR>
<TD align="right" class="Prompt" width="40%"><bean:message key="prompt.state"/></TD>
<TD width="60%">
<html:text property="state" value="<%=address.getState()%>" size="25" maxlength="20"/>
</TD>
</TR>
<TR>
<TD align="right" class="Prompt" width="40%"><bean:message key="prompt.zip"/></TD>
<TD width="60%">
<html:text property="zip" value="<%=address.getZip()%>" size="25" maxlength="20"/>
</TD>
</TR>
<TR>
<TD align="right" class="Prompt" width="40%"><bean:message key="prompt.phone"/></TD>
<TD width="60%">
<html:text property="phone" value="<%=address.getPhone()%>" size="25" maxlength="20"/>
</TD>
</TR>
<TR>
<TD width="17%" class="Prompt" align="right">
<bean:message key="prompt.country"/></TD>
<TD width="29%">
<html:select property="country" value="<%=address.getCountry()%>">
<logic:iterate id="ctr" name="countries" scope="request"
type="oracle.otnsamples.vsm.services.data.Country">
<html:option value="<%=ctr.getCountryID()%>">
<%=ctr.getCountryName()%>
</html:option>
</logic:iterate>
</html:select>
</TD>
</TR>
<TR>
<TD width="40%">
<INPUT TYPE="hidden" value="<%=request.getAttribute("orderID")%>" name="orderID">
</TD>
</TR>
</TABLE>
<BR>
<input type=hidden name="orderID" value="<%=request.getAttribute("orderID")%>" >
<TABLE width="50%" border="0" cellspacing="0" cellpadding="3" align=center>
<TR>
<TD width="30%"> </TD>
<TD width="10%" align="right"> <A HREF="javascript:submitForm()">
<html:img srcKey="image.update" border="0"/></A> </TD>
<TD width="10%" align="center">
<A HREF="javascript:document.forms[1].reset();">
<html:img srcKey="image.reset" border="0"/></A> </TD>
<TD width="10%" align="left"> <A HREF="javascript:history.go(-1);">
<html:img srcKey="image.cancel" border="0"/></A> </TD>
<TD width="29%"> </TD>
</TR>
</TABLE>
</html:form>
<jsp:include page="../misc/commonFooter.jsp" flush="true"></jsp:include>
</BODY>
</html:html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -