The following comment has been added to this issue:
Author: Kevin Edgecomb
Created: Mon, 23 May 2005 8:11 AM
Body:
I would like to know more about using XDoclet with ValidatorForm and
ValidatorActionForm and I cannot seem to find more data. Specifically, I use
complex objects within these forms instead of simple String objects as per the
examples, (e.g.: ContactSDO contact). I use contact.emailAddress to access the
email address property of the contact SDO.
How or where do I use the xdoclet @tags so that I can validate these fields?
---------------------------------------------------------------------
View this comment:
http://opensource.atlassian.com/projects/xdoclet/browse/XDT-598?page=comments#action_16583
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/xdoclet/browse/XDT-598
Here is an overview of the issue:
---------------------------------------------------------------------
Key: XDT-598
Summary: struts-config.xml missing <form> elements when extending
ValidatorForm
Type: Bug
Status: Closed
Priority: Major
Resolution: CANNOT REPRODUCE
Original Estimate: Unknown
Time Spent: Unknown
Remaining: Unknown
Project: XDoclet
Components:
Apache Module
Versions:
1.2 Beta 3
Assignee: xdoclet-devel (Use for new issues)
Reporter: Neal Sanche
Created: Sat, 9 Aug 2003 4:27 PM
Updated: Mon, 23 May 2005 8:11 AM
Description:
When I tried to use the @struts.form name="addressForm" in a class I was
working with that was derived from ValidatorForm I was surprised to see that
XDoclet didn't generate the correct struts-config.xml entries. The class that
I'm writing looks like this:
package org.nsdev.framework.struts;
import org.apache.struts.validator.ValidatorForm;
/**
* A simple form to show validation capabilities.
*
* @author neal
* @struts.form name="emailAddressForm"
*/
public class EmailAddressForm extends ValidatorForm {
private String emailAddress;
public EmailAddressForm() {
}
/**
* @return the emailAddress value.
*/
public String getEmailAddress() {
return emailAddress;
}
/**
* @param string
* @struts.validator type="required,email"
*/
public void setEmailAddress(String string) {
emailAddress = string;
}
}
Nothing too fancy. After loading my application up, it says that it can't find
the form definition. Looking in the struts_config_xml.xdt I can see why. It
only selects classes that are ActionForms.
I replicated the section in struts_config_xml.xdt to do the following:
<XDtClass:forAllClasses type="org.apache.struts.validator.ValidatorForm">
<XDtClass:forAllClassTags tagName="struts:form" superclasses="false">
<form-bean
name="<XDtClass:classTagValue tagName="struts:form" paramName="name"/>"
type="<XDtClass:fullClassName/>"
/>
</XDtClass:forAllClassTags>
</XDtClass:forAllClasses>
Probably would work for ValidatorActionForm as well if there's inheritance on
the 'type' argument, if not another few statements could be added for that as
well. I'll attach a patch if possible to show the context.
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/xdoclet/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
xdoclet-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel