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-9shows 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.commands.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_MESSAGE45");

if

(strErrorCode.equals(ECUserConstants.EC_UREG_ERR_MISSING_LOGONPASSWORDVERIFY)) strErrorMessage = usertext.getString("ERROR_MESSAGE46");

if (strErrorCode.equals(ECSecurityConstants.ERR_MINIMUMLENGTH_PASSWORD)) strErrorMessage = usertext.getString("PASS_ERROR_MESSAGE21");

if (strErrorCode.equals(ECSecurityConstants.ERR_MINIMUMDIGITS_PASSWORD)) strErrorMessage = usertext.getString("PASS_ERROR_MESSAGE22");

if (strErrorCode.equals(ECSecurityConstants.ERR_MINIMUMLETTERS_PASSWORD)) strErrorMessage = usertext.getString("PASS_ERROR_MESSAGE23");

if (strErrorCode.equals(ECSecurityConstants.ERR_USERIDMATCH_PASSWORD)) strErrorMessage = usertext.getString("PASS_ERROR_MESSAGE24");

if (strErrorCode.equals(ECSecurityConstants.ERR_REUSEOLD_PASSWORD)) strErrorMessage = usertext.getString("PASS_ERROR_MESSAGE25");

if (strErrorCode.equals(ECSecurityConstants.ERR_MAXCONSECUTIVECHAR_PASSWORD)) strErrorMessage = usertext.getString("PASS_ERROR_MESSAGE26");

if (strErrorCode.equals(ECSecurityConstants.ERR_MAXINTANCECHAR_PASSWORD)) strErrorMessage = usertext.getString("PASS_ERROR_MESSAGE27");

//Redisplay what was entered when the //invalid entry was submitted.

strLogonID = jhelper.getParameter(ECUserConstants.EC_UREG_LOGONID);

:

:

Chapter 8. Post-migration steps

157

Page 175
Image 175
IBM SG24-6320-00 manual Example 8-9 The content of the modified register.jsp file, @ include file=getResource.jsp%