# Bean Validation (JSR 380)

**URL:** https://discourse.hibernate.org/c/bean-validation/10.md

[Latest](https://discourse.hibernate.org/latest.md) · [Categories](https://discourse.hibernate.org/categories.md)

---

## [About the Bean Validation (JSR 380) category](https://discourse.hibernate.org/t/about-the-bean-validation-jsr-380-category/24)

<div class="topic-metadata">

**Author:** [@gsmet](https://discourse.hibernate.org/u/gsmet)\
**Replies:** 0\
**Last updated:** [January 2, 2018, 8:36pm UTC](https://discourse.hibernate.org/t/about-the-bean-validation-jsr-380-category/24 "2018-01-02T20:36:55Z")

</div>

Discussions about Bean Validation (JSR 380), the specification of the application layer agnostic validation API.

---

## [How can i run beans validation with webcontainer apache tomcat?](https://discourse.hibernate.org/t/how-can-i-run-beans-validation-with-webcontainer-apache-tomcat/412)

<div class="topic-metadata">

**Author:** [@Nykel\_Andersow](https://discourse.hibernate.org/u/Nykel_Andersow)\
**Replies:** 2\
**Last updated:** [June 17, 2025, 7:36pm UTC](https://discourse.hibernate.org/t/how-can-i-run-beans-validation-with-webcontainer-apache-tomcat/412 "2025-06-17T19:36:18Z")

</div>

I just add: \<dependency\> \<groupId\>org.hibernate.validator\</groupId\> \<artifactId\>hibernate-validator\</artifactId\> \<version\>6.0.8.Final\</version\> \</dependency\> \<dependency\> \<groupId\>org.glassfish\<…

---

## [Why Hibernate Validator 7.0.2.Final depend on jakarta.validation-api:3.0.0](https://discourse.hibernate.org/t/why-hibernate-validator-7-0-2-final-depend-on-jakarta-validation-api-3-0-0/5980)

<div class="topic-metadata">

**Author:** [@tangyongshuang](https://discourse.hibernate.org/u/tangyongshuang)\
**Replies:** 1\
**Last updated:** [January 17, 2022, 8:05am UTC](https://discourse.hibernate.org/t/why-hibernate-validator-7-0-2-final-depend-on-jakarta-validation-api-3-0-0/5980 "2022-01-17T08:05:27Z")

</div>

Why Hibernate Validator 7.0.2.Final depend on jakarta.validation-api:3.0.0？not jakarta.validation-api:2.x。 I think jakarta.validation-api:3.0.0 implement Bean Validation 2.0，the version name should named 2.x，but in actu…

---

## [Please apply Apache 2.0 license properly](https://discourse.hibernate.org/t/please-apply-apache-2-0-license-properly/4216)

<div class="topic-metadata">

**Author:** [@Egor\_Nepomnyaschih](https://discourse.hibernate.org/u/Egor_Nepomnyaschih)\
**Replies:** 0\
**Last updated:** [June 2, 2020, 9:52am UTC](https://discourse.hibernate.org/t/please-apply-apache-2-0-license-properly/4216 "2020-06-02T09:52:47Z")

</div>

Dear All Could you please properly apply Apache 2.0 license to jakarta.validation-api module as described in http://www.apache.org/licenses/LICENSE-2.0? It can be achieved either by including the offered header to all s…

---

## [Multiple Pattern validator with OR](https://discourse.hibernate.org/t/multiple-pattern-validator-with-or/3327)

<div class="topic-metadata">

**Author:** [@sanmibuh](https://discourse.hibernate.org/u/sanmibuh)\
**Replies:** 0\
**Last updated:** [October 6, 2019, 2:02pm UTC](https://discourse.hibernate.org/t/multiple-pattern-validator-with-or/3327 "2019-10-06T14:02:04Z")

</div>

Nowadays @Pattern validator is able to match a list of patterns. But the validation passes if all of pattern matches. It could be helpful having a @Pattern.List configuration for tell the need to pass all (AND compositi…

---

## [A proposal for a new bean validation annotation](https://discourse.hibernate.org/t/a-proposal-for-a-new-bean-validation-annotation/2994)

<div class="topic-metadata">

**Author:** [@dawuzi](https://discourse.hibernate.org/u/dawuzi)\
**Replies:** 0\
**Last updated:** [July 20, 2019, 4:50pm UTC](https://discourse.hibernate.org/t/a-proposal-for-a-new-bean-validation-annotation/2994 "2019-07-20T16:50:44Z")

</div>

Hi all, I am new to the forum so I am not sure of the rules guiding creation of new topics. However, I just pushed to github a proposal for a new bean validation annotation. I am also not familiar on the procedure for …

---

## [How can I sort error messages](https://discourse.hibernate.org/t/how-can-i-sort-error-messages/2378)

<div class="topic-metadata">

**Author:** [@phandgean](https://discourse.hibernate.org/u/phandgean)\
**Replies:** 0\
**Last updated:** [February 27, 2019, 7:45am UTC](https://discourse.hibernate.org/t/how-can-i-sort-error-messages/2378 "2019-02-27T07:45:52Z")

</div>

Hi Team, I have multiple validation error messages on the same field(I put some bean level validate messages on the same field), is that possible to manage the order of the messages? Or else can I put some additional pr…

---

## [Need to accept empty for number validation](https://discourse.hibernate.org/t/need-to-accept-empty-for-number-validation/85)

<div class="topic-metadata">

**Author:** [@phandgean](https://discourse.hibernate.org/u/phandgean)\
**Replies:** 2\
**Last updated:** [February 27, 2019, 7:38am UTC](https://discourse.hibernate.org/t/need-to-accept-empty-for-number-validation/85 "2019-02-27T07:38:24Z")

</div>

Hi Team, sometimes we may need to add validation on fields to read number value those transferred as String. if no value to transfer, empty might be received. then we hope to use digits annotation but can’t. is that pos…

---

## [How can I get a map.key as invalidValue](https://discourse.hibernate.org/t/how-can-i-get-a-map-key-as-invalidvalue/2095)

<div class="topic-metadata">

**Author:** [@Selindek](https://discourse.hibernate.org/u/Selindek)\
**Replies:** 0\
**Last updated:** [January 19, 2019, 8:52pm UTC](https://discourse.hibernate.org/t/how-can-i-get-a-map-key-as-invalidvalue/2095 "2019-01-19T20:52:27Z")

</div>

I have the following validation annotation: private Map\<@Size(max = 10) String, Chart\> charts = new HashMap\<\>(); The validation itself work properly, but in the validation-error object I got the following properties: …

---

## [Override property field names in error messages](https://discourse.hibernate.org/t/override-property-field-names-in-error-messages/766)

<div class="topic-metadata">

**Author:** [@nhojpatrick](https://discourse.hibernate.org/u/nhojpatrick)\
**Replies:** 6\
**Last updated:** [May 16, 2018, 10:49am UTC](https://discourse.hibernate.org/t/override-property-field-names-in-error-messages/766 "2018-05-16T10:49:03Z")

</div>

It might be possible but I’ve been looking for months but found nothing; I’ve got this json; { “inner\_object”: { “string\_variable”: “” } } Using Jackson to map to these object; import com.fasterxml.jackson.annota…

---

## [How can I retrieve current validation context's groups in a Validator?](https://discourse.hibernate.org/t/how-can-i-retrieve-current-validation-contexts-groups-in-a-validator/414)

<div class="topic-metadata">

**Author:** [@yanicks](https://discourse.hibernate.org/u/yanicks)\
**Replies:** 3\
**Last updated:** [March 28, 2018, 1:46pm UTC](https://discourse.hibernate.org/t/how-can-i-retrieve-current-validation-contexts-groups-in-a-validator/414 "2018-03-28T13:46:48Z")

</div>

Hi guys, As part of a project, I would like to trigger a @Valid conditionally on an object if a value is not null. To do that i have created a custom validator named ValidateFieldIfAnotherIsNotNull which I’m using as an…

---

## [Nested cross field validation](https://discourse.hibernate.org/t/nested-cross-field-validation/247)

<div class="topic-metadata">

**Author:** [@perceptron8](https://discourse.hibernate.org/u/perceptron8)\
**Replies:** 0\
**Last updated:** [February 18, 2018, 5:56pm UTC](https://discourse.hibernate.org/t/nested-cross-field-validation/247 "2018-02-18T17:56:05Z")

</div>

Hi! Maybe I’m doing something incorrectly, but I’d like to kindly ask you if there is a better way of doing deeply nested cross-validation, as I find Bean Validation API hard to use i such cases. Hope that it’s a good …
