Business rule validators and command handler in CQRS

It’s important to know that commands can be rejected after they are sent to the handler. At the very least, you could encounter a concurrency violation that cannot be detected until the aggregate root is touched. But also, the validation that can occur outside of the entity is simple validation. Not only string lengths, numeric … Read more

How to let validation depend on the pressed button?

I understand that you want to filter based on the name input field. The <p:commandButton> sends by default an ajax request and has a process attribute wherein you can specify which components you’d like to process during the submit. In your particular case, you should then process only the name input field and the current … Read more

JSF doesn’t support cross-field validation, is there a workaround?

The easiest custom approach I’ve seen and used as far is to create a <h:inputHidden> field with a <f:validator> wherein you reference all involved components as <f:attribute>. If you declare it before the to-be-validated components, then you can obtain the submitted values inside the validator by UIInput#getSubmittedValue(). E.g. <h:form> <h:inputHidden id=”foo” value=”true”> <f:validator validatorId=”fooValidator” /> … Read more

Why is client-side validation not enough?

Client-side validation – I assume you are talking about web pages here – relies on JavaScript. JavaScript powered validation can be turned off in the user’s browser, fail due to a scripting error, or be maliciously circumvented without much effort. Also, the whole process of form submission can be faked. Therefore, there is never a … Read more

How to add form validation pattern in Angular 2?

Now, you don’t need to use FormBuilder and all this complicated valiation angular stuff. I put more details from this (Angular 2.0.8 – 3march2016): https://github.com/angular/angular/commit/38cb526 Example from repo : <input [ngControl]=”fullName” pattern=”[a-zA-Z ]*”> I test it and it works 🙂 – here is my code: <form (ngSubmit)=”onSubmit(room)” #roomForm=’ngForm’ > … <input id=’room-capacity’ type=”text” class=”form-control” [(ngModel)]=’room.capacity’ … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)