You have to do this in the action method or write a custom validator. Someone did some post some code in a blog recently about how to build a JSF validator to generically compare two fields.
Thank you very much for the answer. Could you please give a link to this blog? I found for example http://balusc.blogspot.com/2007/12/validator-for-multiple-fields.html but maybe on the blog you are refering to there is a better solution.