Well I really think there is... Why?so i dont think there is problem of version conflict...
spring.jar already contains everything which is in spring-beans.jar, spring-context.jar etc... So either remove spring-*.jar or remove the spring.jar.
Well I really think there is... Why?so i dont think there is problem of version conflict...
spring.jar already contains everything which is in spring-beans.jar, spring-context.jar etc... So either remove spring-*.jar or remove the spring.jar.
Marten Deinum
Java Consultant / Pragmatist / Open Source Enthousiast / Author
Pro Spring MVC: With Web Flow
Conspect
Have you read the reference guide.
Use the [ code ] tags, young padawan
Hi,
How do i access an object in validation.xml. I am using Bean Validation Framework.
My class:
My employee-validation.xmlCode:public class Employee { private String firstName; private String lastName; private Department department; //with getters and setters }
can someone tell me how i can access the elements of department object. Code in bold doesnt seem to be working.Code:<?xml version="1.0" encoding="ISO-8859-1"?> <validation xmlns="http://www.springmodules.org/validation/bean" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://localhost:8080/BVF http://localhost:8080/BVF/validation.xsd"> <class name="Employee"> <validator class="EmployeeValidator"/> <property name="firstName"> <not-blank message="FirstName cannot be left blank"/> <length min="5" max="20" message="First Name Length cannot be less than 5 or more than 20"/> </property> <property name="lastName"> <not-blank message="LastName cannot be left balnk"/> <length min="5" max="20" message="Last Name Length cannot be less than 5 or more than 20"/> </property> <property name="department.name"> <not-blank message="Name cannot be blank"/> <length min="5" max="20" message="Name Length cannot be less than 5 or more than 20"/> </property> <property name="department.pinCode"> <not-blank message="Pin Code cannot be left blank"/> <regexp expression="^[A-Z\d{1}]\d{4}[\s\-]*\d*$" message="PinCode is invalid"/> <length min="5" max="10" message="Pincode length should be between 5 and 10"/> </property> </class> </validation>
I am so sorry... i didnt mean to annoy you
I had a similar problem like the first post in this thread, but the solution making the class static was not valid for my problem. I wanted to call methods of the outer class directly from the inner class.
Spring instantiates beans with reflection not with new, and with reflection you have a constructor for non static inner classes that takes an instance of the outer class as parameter.
so the config should work for this example.
<bean id="customerBean" class="com.models.CustomerBean" />
<bean id="customerFormValidator" class="com.models.CustomerBean$CustomerBeanValidat or">
<constructor-arg ref="customerBean" />
</bean>
for a longer explanation check my blog post about this:
boris-dev.blogspot.com/2008/08/spring-and-inner-classes.html
Boris, you've replied to a thread that's just a few days away from being a year old!
![]()
And regarding your blog entry about being able to extend two classes, there's something you can do with Spring's AOP to get the same or similar effect. I've never used it and only know about it because I'm reading
http://apress.com/book/view/1590599799
and he goes over it in one of the chapters on AOP.