struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pratik Patel <prpa...@ibiblio.org>
Subject Re: How do I populate a DynaValidatorForm?
Date Fri, 26 Sep 2003 15:18:45 GMT
Fenderbosch, Eric wrote:

> Where do you specify the
> @struts.form-field (0..*)
> tags so that XDoclet creates the form for you?
> Right now, I have a hand coded form and XDoclet creates the <form-bean/> section
of my struts-config for me, but I'm not creating the actual ActionForm subclass with XDoclet.

In my domain objects; here's the objects from a Struts app I'm currently 
working on:

Domain Object		XDoclet Generated ActionForm
User			UserForm
Forum			ForumForm
Post			PostForm
Thread			ThreadForm


Sample domain object:

package org.sourceforge.jwebforum.model;
import java.util.Date;

/**
  * @struts.form include-all="true"
  * extends="org.sourceforge.jwebforum.webapp.form.BaseForm"
  */
public class User {
     private String password;
     private String email;
     private Date signupdate;
     private String firstname;
     private String lastname;
     private String username;
     private long userid;

     public User(String password, String email, java.sql.Timestamp 
signupdate, String firstname, String lastname, String username, long 
userid) {
         this.password = password;
         this.email = email;
         this.signupdate = signupdate;
         this.firstname = firstname;
         this.lastname = lastname;
         this.username = username;
         this.userid = userid;
     }

     public User() {
     }

     /** Password of the user.
      * @struts.validator type="required" msgkey="errors.required"
      */
     public String getPassword() {
         return password;
     }
...




I hope to have this Struts application uploaded to sourceforge within 
two weeks (with full source, of course). It's still undergoing some 
refactoring, but I can send you the current snapshot if you're interested.


cheers,
Pratik



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message