Chapter 8. Post-migration steps 157
Draft Document for Review July 28, 2004 7:33 pm 6320ch_DEV_post_migration.fm
the following summary of changes has been added to improve the error handling:
Add import statement to import the package which contains the new error
codes
Add logic to check the error code returned and create error message to show
user
Example 8-9 shows part of the content of the modified register.jsp file. The
changes are outlined in bold.
Example 8-9 The content of the modified register.jsp file
:
:
:
<%@ page import="com.ibm.commerce.datatype.*" %>
<%@ page import="com.ibm.commerce.usermanagement.co mmands.ECUserConstants" %>
<%@ page import="com.ibm.commerce.common.beans.*" %>
<%@ page import="com.ibm.commerce.security.commands .ECSecurityConstants" %>
<%@ include file="getResource.jsp"%>
:
:
:
if (strErrorCode.equals(ECUserConstants.EC_ADDR _ERR_BAD_LASTNAME))
strErrorMessage = usertext.getString("ERROR_MES SAGE45");
if
(strErrorCode.equals(ECUserConstants.EC_UREG_ER R_MISSING_LOGONPASSWORDVERIFY))
strErrorMessage = usertext.getString("ERROR_MES SAGE46");
if (strErrorCode.equals(ECSecurityConstants.ERR _MINIMUMLENGTH_PASSWORD))
strErrorMessage = usertext.getString("PASS_ERRO R_MESSAGE21");
if (strErrorCode.equals(ECSecurityConstants.ERR _MINIMUMDIGITS_PASSWORD))
strErrorMessage = usertext.getString("PASS_ERRO R_MESSAGE22");
if (strErrorCode.equals(ECSecurityConstants.ERR _MINIMUMLETTERS_PASSWORD))
strErrorMessage = usertext.getString("PASS_ERRO R_MESSAGE23");
if (strErrorCode.equals(ECSecurityConstants.ERR _USERIDMATCH_PASSWORD))
strErrorMessage = usertext.getString("PASS_ERRO R_MESSAGE24");
if (strErrorCode.equals(ECSecurityConstants.ERR _REUSEOLD_PASSWORD))
strErrorMessage = usertext.getString("PASS_ERRO R_MESSAGE25");
if (strErrorCode.equals(ECSecurityConstants.ERR _MAXCONSECUTIVECHAR_PASSWORD))
strErrorMessage = usertext.getString("PASS_ERRO R_MESSAGE26");
if (strErrorCode.equals(ECSecurityConstants.ERR _MAXINTANCECHAR_PASSWORD))
strErrorMessage = usertext.getString("PASS_ERRO R_MESSAGE27");
//Redisplay what was entered when the
//invalid entry was submitted.
strLogonID = jhelper.getParameter(ECUserConstants.E C_UREG_LOGONID);
:
: