Formats a credit card number.

Attributes

Attributes

Description

CreditCard

Automatic

Set to true or false to indicate whether to format this value as a credit card.

maskcharacter

The masking character. The default character is X.

numcharsunmasked

The number of characters to unmask, from right to left.

groupingsize

The number of characters to group within the credit card string.

Usage Notes

You can display a credit card number as a series of number groupings. You determine the number of items in each grouping by setting the groupingsize attribute. For example:

<dsp:valueof bean="CreditCard.number"converter="CreditCard" groupingsize="4"/>

This example might render a credit card number with four numbers in each grouping as follows:

7845 5624 5586 1313

In general, you should display the entire credit card number only when it is initially entered, in order to facilitate confirmation. Afterward, you typically display only a portion of the number, so users can recognize it while ensuring confidentiality. You can control number masking with two attributes:

For example:

Tag

Result

<dsp:valueof bean="CreditCard.num"
 converter="CreditCard" numcharsunmasked="4"/>

XXXXXXXXXXXX3456

<dsp:valueof bean="CreditCard.num" converter="CreditCard"
maskcharacter="*" numcharsunmasked="12"/>

****567890123456


Copyright © 1997, 2015 Oracle and/or its affiliates. All rights reserved. Legal Notices