Questions tagged [valdr-bean-validation]

valdr Bean Validation is a JSR 303 plugin for valdr i.e. JSR 303 for AngularJS

8 questions
9
votes
3 answers

Gradle - Add additional task to existing task

I'm working on a project that uses EJB2s. The created EJB Jars require additional processing by the application server before they're bundled in the war/ear and deployed. I have created a custom task that works to do the additional processing if I…
babbitt
  • 871
  • 11
  • 22
1
vote
1 answer

How to internationalise @Pattern(regexp="(^$|[0-9]{10})") in bean validation?

I am using bean validation to validate my entity, it works fine according to different locales and it shows region-specific error messages, but I want to internationalize a field 'ContactNo' according to the region like my error messages…
1
vote
2 answers

JSR 303 - defined size or null

I have following field with JSR-303 validation: @Size(min = 6, max = 6, message = "Field needs to be 6 characters") private String field; Requirement for the field is to be 6 characters or null. (I then use valdr-bean-validation…
FazoM
  • 4,777
  • 6
  • 43
  • 61
1
vote
1 answer

Messages from ValidationMessages.properties in generated JSON

I'm using the ValidationRulesServlet to generate valdr JSON for my APIs. Currently the generated JSON looks like this: { "Person" : { "firstName" : { "size" : { "min" : 2, "message" :…
Kristian S
  • 68
  • 1
  • 7
1
vote
1 answer

Dynamic valdr-type

Would it be possible to have a dynamic valdr-type? I am trying to build a dynamic form based off of nested objects and valdr-type="{{constraint}}, for example, but is not working. Can valdr-type be dynamic or does it have to be set with…
user4462026
0
votes
1 answer

Bean validation constraint Pattern: match N digits regexp not working in XML

Bean validation constraint Pattern(match N digits regexp) not working if specified in XML. e.g., public class Foo { @Pattern(regexp="\\d{10}") private String phoneNumber; } phoneNumber: 1234567890 Annotation works. XML:
eastwater
  • 4,624
  • 9
  • 49
  • 118
0
votes
2 answers

Validate if greater then zero - using valdr-bean-validation

I would like to make sure that totalAmount is greater then 0. I have following code to in my Java bean: @NotNull(message = "Total amount must be entered") @Digits(integer = 8, fraction = 2, message = "Please enter a valid amount less than…
FazoM
  • 4,777
  • 6
  • 43
  • 61
0
votes
1 answer

Valdr integration with Spring

I am interested in using valdr Bean Validation for my Spring 4 REST project, but it seems like valdr Bean Validation is only available with CLI and as Servlets. I tried integrating it with my Spring project but it doesn't seem to work. I have been…
Dexter
  • 1,621
  • 3
  • 18
  • 38