You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ricky Yahoo <Ri...@hotmail.com> on 2003/11/26 15:44:15 UTC

DynaActionForm basic problem.

hi, thanks for helping me! i have a problem by using DynaActionForm..
some fragment of my struts-config.xml about form bean is:

    <!-- article bean -->
    <form-bean name="articleBean" type="com.struts.bean.DynaArticleForm">
      <form-property name="article_id" type="java.lang.Long" />
      <form-property name="article_title" type="java.lang.String" />
      <form-property name="post_date" type="java.sql.Date" />
    </form-bean>

and the class "com.struts.bean.DynaArticleForm" is extends DynaActionForm
Class to validate the form .and it directly to the excuse method of Action

public class DynaArticleForm
    extends DynaActionForm {
  public ActionErrors validate(ActionMapping mapping,
                               HttpServletRequest request) {
    ActionErrors errors = new ActionErrors();

    errors.add("author_id", new
ActionError("admin.article.author.missing"));
    return errors;
  }

but the process can't return any errors, in fact, i have added the errors to
ActionErrors....
i follow the article in
http://www.developer.com/java/ejb/article.php/2214681 and it says:

"We also need to change the definition of the form in struts-config.xml to
use this new class instead of the generic DynaActionForm class. When we do
this, the validation functionality is returned"

what's the problem with my program ? could you please tell me..... thanx

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


Re: DynaActionForm basic problem.

Posted by Ricky Yahoo <Ri...@hotmail.com>.
a moment later, i have found the reasons.... :)

----- Original Message -----
From: "Ricky Yahoo" <Ri...@hotmail.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Wednesday, November 26, 2003 10:44 PM
Subject: DynaActionForm basic problem.


> hi, thanks for helping me! i have a problem by using DynaActionForm..
> some fragment of my struts-config.xml about form bean is:
>
>     <!-- article bean -->
>     <form-bean name="articleBean" type="com.struts.bean.DynaArticleForm">
>       <form-property name="article_id" type="java.lang.Long" />
>       <form-property name="article_title" type="java.lang.String" />
>       <form-property name="post_date" type="java.sql.Date" />
>     </form-bean>
>
> and the class "com.struts.bean.DynaArticleForm" is extends DynaActionForm
> Class to validate the form .and it directly to the excuse method of Action
>
> public class DynaArticleForm
>     extends DynaActionForm {
>   public ActionErrors validate(ActionMapping mapping,
>                                HttpServletRequest request) {
>     ActionErrors errors = new ActionErrors();
>
>     errors.add("author_id", new
> ActionError("admin.article.author.missing"));
>     return errors;
>   }
>
> but the process can't return any errors, in fact, i have added the errors
to
> ActionErrors....
> i follow the article in
> http://www.developer.com/java/ejb/article.php/2214681 and it says:
>
> "We also need to change the definition of the form in struts-config.xml to
> use this new class instead of the generic DynaActionForm class. When we do
> this, the validation functionality is returned"
>
> what's the problem with my program ? could you please tell me..... thanx
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>

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