bean-validation Questions
1
Solved
I'm stuck in an apparently simple problem: I want to perform some custom validation based on the object id in a PUT request.
@RequestMapping(value="/{id}", method=RequestMethod.PUT)
public Respon...
Waterfront asked 7/10, 2017 at 5:52
3
I am currently trying to provide a custom validation message using bean validation.
Currently using spring mvc 3.1.1 + apache bean validation.
In my bean, i specify :
@Size(min=1, max=50)
privat...
Hose asked 5/5, 2012 at 12:43
0
JSR-380 adds support for validating containers elements (inside collections, optional) by annotating the parameterized type:
List<@Email String> emails;
Is there any way to get this to wor...
Wessling asked 7/9, 2017 at 14:31
1
When using @AssertTrue in methods, the method is invoked 4 times during validation (Bean Validation)
When using bean validation to validate the state of an object, the method annotated with @AssertTrue is called 4 times whenever the validation is invoked. It should only be called once per invocati...
Thinker asked 31/8, 2017 at 20:13
2
I have a JPA entity representing a company. It has a field representing the company's website URL. I need to validate that the URL is a valid website URL prior to persisting. I suppose only URLs st...
Gaiseric asked 30/8, 2017 at 21:23
0
I'm working on project with Spring boot 1.5.4.RELEASE with Spring Data JPA.
Stuck on issue that Hibernate validator isn't executed when updating entity or at least in some cases it doesn't validat...
Marinamarinade asked 30/8, 2017 at 14:24
2
Use Case:
let's design a RESTful create operation using POST HTTP verb - creating tickets where creator (assigner) specifies a ticket assignee
we're creating a new "ticket" on following location:...
Weldonwelfare asked 28/10, 2015 at 21:33
2
Solved
I am using Spring Boot 1.5.2.RELEASE and not able to incorporate JSR - 349 ( bean validation 1.1 ) for @RequestParam & @PathVariable at method itself.
For POST requests, if method parameter i...
Cana asked 2/6, 2017 at 4:15
1
Solved
Is there a way to integrate spring RestTemplate with JavaBean validation api. ?
I know there is a integration for spring controller. you can put @Valid on request body param and if Employee is not...
Mckenney asked 26/7, 2017 at 17:19
3
I have a custom validator which I use to ensure that some business rules are applied on an entity before it is saved.
For example (a hypothetical one), when ProductPrice, defined below, is saved,...
Shovel asked 17/7, 2017 at 8:23
2
Solved
By default Bean Validation gets Locale based on Locale.getDefault(), which is common to whole JVM.
How to change BeanValidation's Locale for current EJB method call?
I'm using JavaEE7 and want to...
Freon asked 15/4, 2014 at 13:31
6
Solved
I want to be able to do something like:
@Email
public List<String> getEmailAddresses()
{
return this.emailAddresses;
}
In other words, I want each item in the list to be validated as an e...
Brunhilda asked 29/11, 2010 at 21:20
4
Solved
I'm building a REST webservice in Java using Spring, Jersey and Hibernate (JPA).
Now I'm trying to add support for validation in my resources. JSR-303 (Bean validation) naturally appeared as a sui...
Capillaceous asked 8/1, 2013 at 15:18
1
Solved
Bean Validation is a good option to validate objects, but how to customize the response of a REST API (using RESTeasy) when a ConstraintViolationException is thrown?
For example:
@POST
@Path("com...
Cecilla asked 1/6, 2017 at 12:53
2
Solved
If you are familiar with the Bean Validation Framework you know that you cannot get the name of a method argument. So if you do a @NotNull constraint on the first argument of a method and the valid...
Iormina asked 19/3, 2014 at 4:54
1
Solved
We encountered a problem with legacy code. There is a validation set for a "username" field, validating its length and making sure it contains at least one letter:
@Column(name = "username")
@Size...
Fortyfive asked 14/5, 2017 at 12:47
4
Solved
I created an EJB Session facade in my Netbeans 7 for saving my entity.
I have a manytoone mapping between my Insurance and RatePlan Class.
public class Insurance{
@ManyToOne(optional=false)
@Jo...
Etruria asked 28/9, 2011 at 7:45
7
Solved
I would like to store birthdate so I chose date at MySQL, when I create my entities based in my database, it turns out like this:
import java.util.Date;
// ..code
@NotNull(message="fill you bir...
Juxtapose asked 10/10, 2012 at 15:28
1
Solved
From JSR-339:
For simplicity, JAX-RS implementations are NOT REQUIRED to support processing groups other than Default.
This severely limits usefulness of validation in JAX-RS because for examp...
Jamima asked 29/1, 2017 at 18:11
3
Solved
I have a question related to javax.validation.constraints.NotNull annotation.
In my project i do have classes tree like following :
@Inheritance(strategy = InheritanceType.JOINED)
class Ssss {
@Ma...
Helical asked 7/2, 2017 at 8:37
1
Solved
I have configured my Spring Boot 1.5.1 application with JSR 303 validation. Right now I'm getting ConstraintViolationException in case of wrong data.
Is it possible to get a detailed message(now i...
Ivett asked 4/2, 2017 at 14:2
3
Solved
In my Spring Boot 1.5.1 application I'm trying to configure support of JSR-303 / JSR-349 validation.
I have added a following annotations @NotNull @Size(min = 1) to my method:
@Service
@Transacti...
Wollis asked 2/2, 2017 at 8:31
1
Solved
I am attempting to validate String Date using javax.validation & Hibernate validation. i need to check given String date should be past and it should be correct yyyyMMdd format with all constra...
Robi asked 18/1, 2017 at 11:25
0
Here is my java code
class AbstractO{
public interface Save{}; // for groups
public interface Update{}; // for groups
}
class A extends AbstractO{
public Integer id;
@NotNull(groups={A.Save.cl...
Sapowith asked 4/1, 2017 at 6:21
1
I'm trying to create a custom bean validation, so I write this custom constraint:
@Documented
@Constraint(validatedBy = ValidPackageSizeValidator.class)
@Target({ElementType.TYPE})
@Retention(Rete...
Lunar asked 26/12, 2016 at 0:40
© 2022 - 2024 — McMap. All rights reserved.