previous | index | next

A Custom Converter for Credit Card Numbers

A user should be able to enter credit card numbers with or without spaces:
   1234567890123456
   1234 5678 9012 3456 

The getAsObject method for a custom credit card converter should:

The getAsString method for a custom credit card converter should:

Here is a CreditCardConverter.java class that implements javax.faces.converter.Converter.


previous | index | next