You need to have at least one validation rule (@spring.validator on a
setter method). If no fields are required, you can remove the
"beanValidator" property from your controller's bean definition.
Matt
On 1/18/07, Luke <[EMAIL PROTECTED]> wrote:
Hello;
I'm tying to use the ant install-detailed task in appgen (appfuse 1.9.4) to
create some code based on a pojo.
Everything creates fine, but at run time Tomcat throws this out:
Error creating bean with name 'studentFormController' defined in
ServletContext resource [/WEB-INF/action-servlet.xml]: Initialization of
bean failed; nested exception is java.lang.IllegalArgumentException:
Validator [EMAIL PROTECTED]
does not support command class [com.example.model.Student]
Is the Pojo missing something? Any tips?
Thanks,
Luke
package com.example.model;
import java.io.Serializable;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
/**
* @hibernate.class table="student"
*/
public class Student extends BaseObject implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
private String firstName;
private String lastName;
/**
* @hibernate.property column="first_name" not-null="true" length="50"
*/
public String getFirstName() {
return firstName;
}
/**
* @param firstName the firstName to set
*/
public void setFirstName(String firstName) {
this.firstName = firstName;
}
/**
* @return Returns the id.
* @hibernate.id column="id" generator-class="native"
unsaved-value="null"
*/
public Long getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Long id) {
this.id = id;
}
/**
* @hibernate.property column="last_name" not-null="true" length="50"
*/
public String getLastName() {
return lastName;
}
/**
* @param lastName the lastName to set
*/
public void setLastName(String lastName) {
this.lastName = lastName;
}
/**
* @see java.lang.Object#equals(Object)
*/
public boolean equals(Object object) {
if (object == this) {
return true;
}
if (!(object instanceof Student)) {
return false;
}
Student rhs = (Student) object;
return new EqualsBuilder().append(this.firstName, rhs.firstName)
.append(this.id, rhs.id).append(this.lastName, rhs.lastName)
.isEquals();
}
/**
* @see java.lang.Object#hashCode()
*/
public int hashCode() {
return new HashCodeBuilder(-1400318123, 542271661).append(
this.firstName).append(this.id).append(this.lastName)
.toHashCode();
}
/**
* @see java.lang.Object#toString()
*/
public String toString() {
return new ToStringBuilder(this).append("lastName", this.lastName)
.append("id", this.id).append("firstName", this.firstName)
.toString();
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
http://raibledesigns.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]