I am creating a form that posts data to a external url (authorizeNet DPM). I need jsf to validate the inputText prior to allowing the submission to happen. How do I get the validation rules to work in this case?
<form action="EXTERNAL_URL" method="POST">
<h:inputText id="x_card_num" required="true" requiredMessage="A 16-digit credit card number is required.">
<f:ajax event="change" render="@this" />
<f:validateLength maximum="20" minimum="3" />
<f:validateRegex pattern="[0-9]{16}" />
</h:inputText>
<h:commandButton value="Submit" id="submit"/>
</form>
JSF works on the server, so you always need to postback to your own server first. From there you could manually do a post to the target server (server to server communication). You could even capture the response of that server and stream it to the client.
Your client will see the URL of your server though, unless the target server responds with a redirect.