Bean Validation Groups – Understanding it correctly

First, here is the javax.validation javadoc When you want to validate a bean, you actually call Validator.validate(T object, java.lang.Class… groups) It will then check the validations constraints of the specified groups. It allows to use several validation cases. What you describe in your question is accurate. Note, if you do not put any group on … Read more

View all fields / properties of bean in JSP / JSTL

Replace object with the bean to determine. <c:set var=”object” value=”${product}” /> Display all declared fields and their values. <c:if test=”${not empty object[‘class’].declaredFields}”> <h2>Declared fields <em>&dollar;{object.name}</em></h2> <ul> <c:forEach var=”field” items=”${object[‘class’].declaredFields}”> <c:catch><li><span style=”font-weight: bold”> ${field.name}: </span>${object[field.name]}</li> </c:catch> </c:forEach> </ul> </c:if> Display all declared methods. <c:if test=”${not empty object[‘class’].declaredMethods}”> <h2>Declared methods<em>&lt;% object.getName() %&gt;</em></h2> <ul> <c:forEach var=”method” items=”${object[‘class’].declaredMethods}”> <c:catch><li>${method.name}</li></c:catch> … Read more

Spring @ConditionalOnProperty havingValue = “value1” or “value2”

Spring Boot provides AnyNestedCondition for created a condition that will match when any nested condition matches. It also provides AllNestedConditions and NoneNestedConditions for matching when all nested conditions or no nested conditions match respectively. For your specific case where you want to match a value of value1 or value2 you would create an AnyNestedCondition like … Read more

javax.el.PropertyNotFoundException: Property ‘foo’ not found on type com.example.Bean

javax.el.PropertyNotFoundException: Property ‘foo’ not found on type com.example.Bean This literally means that the mentioned class com.example.Bean doesn’t have a public (non-static!) getter method for the mentioned property foo. Note that the field itself is irrelevant here! The public getter method name must start with get, followed by the property name which is capitalized at only … Read more

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