bean-validation Questions

4

Solved

I have a Spring based webapp. I am using several repository classes with annotations @Repository, @Transactional in my Controllers. That part works fine. I created a Custom Constraint Validator wh...
Alburg asked 28/11, 2012 at 7:19

1

Solved

javax validation not working on method parameters.. This is a test code and none of javax validation works on method parameter... @RequestMapping(value = "/{id}", method = RequestMethod.PUT, param...
Vulpecula asked 20/10, 2016 at 18:5

1

How to create a validator restrictions for more fields through annotation in spring 4.* for example @UniqueValidator @Entity @Table(name = "persons") @UniqueValidator(message="Peson already e...
Hilarius asked 15/5, 2015 at 14:8

1

Solved

Is there a validation annotation for Spring that will do something like: @ValidString({"US", "GB", "CA"}) final String country; and validate that the string is one of the supported values in the...
Cowcatcher asked 17/10, 2016 at 22:31

2

Solved

There is a place in jsonschema2pojo documentation describing possibility to enable JSR-303 annotations generation. If I understand correctly it can be done via Maven plugin configuration. Could som...
Blanchard asked 5/10, 2016 at 13:46

2

Solved

I have a variable name in a bean. I want to add @Pattern validation to accept only alphanumeric. Currently, I have this one. @NotNull @Pattern(regexp = "{A-Za-z0-9}*") String name; But the ...
Donets asked 5/7, 2013 at 4:22

1

Solved

Spring 4.3.2 I need to call SmartValidator.validate() manually and I need it utilize the validation groups that I have defined on the target entity. The javadoc says this... "This variant of va...
Selfrenunciation asked 29/8, 2016 at 15:14

1

Solved

I'm working on a entity library. I put some bean-validation annotations on my Entities. I strongly believe a bean-validation implementation in on the class path. @javax.validation.constraints.NotN...
Cynthea asked 25/7, 2016 at 6:1

3

I have an entity class which uses an enum type for one of the properties, and I am getting the following exception when I try to persist the entity: javax.validation.UnexpectedTypeException: No va...
Insupportable asked 4/8, 2011 at 6:30

2

Solved

I have an entity like this: @Entity @Table(name = "transaction_receiver") public class TransactionReceiver implements Serializable, Addressable { private static final long serialVersion...
Elam asked 17/6, 2016 at 10:17

3

Example: public String getStudentResult(@RequestParam(value = "regNo", required = true) String regNo, ModelMap model){ How can I use @valid for the regNo parameter here?
Handedness asked 7/10, 2014 at 5:59

4

Solved

I have to take input for paper_name and date_of_birth as int and date datatype respectively from a form. Below is the code: <li> Number:<input type="text" name="paper_number" ></li...
Burnejones asked 4/3, 2016 at 9:28

1

I have a small project (using Spring 4.2.0, Spring Webflow 2.4.2, Hibernate validator 5.2.2) that is working as expected in the servlet world, but after having transformed it to a portlet, the vali...

4

Solved

I was attempted to apply multiple @Pattern annotations to a single field: @Pattern(regexp = "(?=.*[0-9])", message = "Password must contain one digit.") @Pattern(regexp = "(?=.*[a-z])", message = ...
Shirt asked 25/4, 2013 at 21:25

1

Solved

I have this Entity, that is a super class: @Entity public class Father implements Serializable{ @Column(name = "name") @Size(min=1, max=10) @Pattern(regexp="^[A-Za-z ]*$") @NotNull private ...
Quarter asked 18/12, 2015 at 15:30

6

Solved

I am currently working on Spring MVC web app and trying to hook up validation using the @Valid annotation. When I fire up the application I'm getting the following exception: javax.validation.Vali...
Fess asked 20/10, 2010 at 22:54

1

Solved

For example, I'd like to have @Nonnegative, defined as @Min(0), and @DaySeconds, defined as @Min(0) @Max(86399).
Dick asked 23/11, 2015 at 10:11

1

Solved

Context We use a javax.ws.rs.ext.ExceptionMapper<Exception> annotated as @javax.ws.rs.ext.Provider to handle all exceptions. Internally this ExceptionMapper is distinguishing between differe...
Discovery asked 17/11, 2015 at 14:55

2

Solved

We are creating a RESTful API with SpringMVC and we have a /products end point where POST can be used to create a new product and PUT to update fields. We are also using javax.validation to validat...
Menton asked 16/11, 2015 at 18:10

2

Solved

I'm using JSR-303 validation (hibernate-validator) for an entity with a few different rules to be applied. Would rather not stack up multiple @Constraint annotations for these and instead use a sin...

3

Solved

There is the @NotNull annotation which validates that a certain object is not null. There is the @NotEmpty annotation which validates that a certain collection/map/string/... is not empty. Is the...
Juan asked 16/1, 2015 at 12:37

2

Solved

I use to collect all my validation constraints in a common library. In the root of the jar I put a ValidationMessages_it.properties file. All works fine, if I put this library into a jsf 2 war proj...
Evansville asked 22/7, 2012 at 9:42

1

Solved

I'm using Bean Validation with RestEasy in Wildfly 8.2.0.Final: @Path("/user") @Produces(MediaType.APPLICATION_JSON) public class UserEndpoint { //more code @GET @Path("/encrypt/{email}") pub...
Bakerman asked 22/9, 2015 at 19:33

2

Solved

In my Spring Boot app I have a backing bean where I am using JSR303 validation. In the annotation, I have specified the message code: @NotBlank(message = "{firstname.isnull}") private String first...
Peeress asked 13/2, 2015 at 4:55

1

I'm using Jersey in Java for a simple web server. I'm trying to handle with url query parameters, like /path?value1=X&value2=Y&value3=Z I was able to extract the query value by using the...
Laser asked 9/9, 2015 at 16:33

© 2022 - 2024 — McMap. All rights reserved.