Hi Brandon,

As you mean, I must code new BaseBean, which extends from ValidatorActionForm more than using default BaseBean of iBatis which extends from ActionForm?

If so, thank you very much ... may be my problem is solved by you :")

again, thank you!

Pham

----- Original Message ----- From: "Brandon Goodin" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Thursday, April 14, 2005 10:18 PM
Subject: Re: [HELP] How to do validation in Struts + iBatis + DAO???



"Right, like Mark said, I'm following JPetStoreExample, Rick :), when you use
DAO, ur Bean must extends from Basebean of DAO pattern."


Pham, the way you are explaining this doesn't seem quite right. The
inheritence of the Presentation bean goes as such:

AccountBean <- AbstractBean <- BaseBean <- ValidatorActionForm

You Dao class inheritence goes like this:

AccountSqlMapDao (implements AccountDao) <- BaseSqlMapDao <- SqlMapDaoTemplate

Notice that your Dao has nothing do with the BaseBean. The AccountBean
is PURELY presentation. It is akin to the AcitonForm. What JPetstore4
does is to conceptually combine the ActionForm and Action class while
abstracting you away from the servlet spec. Since all of you
presentation beans ultimately extend ValidatorActionForm you are able
to perform validations as normal. Please don't confuse the Dao and
Presentation layers. The Presentation layer merely calls the Service
Layer which in turn calls the Dao layer. The domain/model objects are
the only shared elements among the various layers.

Brandon

On 4/12/05, Pham Anh Tuan <[EMAIL PROTECTED]> wrote:
Right, like Mark said, I'm following JPetStoreExample, Rick :), when you use
DAO, ur Bean must extends from Basebean of DAO pattern.


So, if I want to do Validation, I only do it on Server. So, if I want do
Validation on Client, I can not but I use javascript.

so, thank you all :)

----- Original Message -----
From: "Mark Bennett" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Tuesday, April 12, 2005 7:32 PM
Subject: Re: [HELP] How to do validation in Struts + iBatis + DAO???

Rick, I believe that he is referring the the JPetStore download from the
iBatis site. I am also using the additional struts helper package that comes
in that demo. So no, it really doesn't have anything to do with iBatis
except that it probably came from that web site.
Pham, if you continue to follow the JPetSoreExample then can do server side
validation the way that it does by extending the validate() method of
BaseBean. Then you can set validate="true" in your struts-config.
Mark


On Apr 12, 2005 12:54 AM, Rick Reumann <[EMAIL PROTECTED]> wrote:
>
> Pham Anh Tuan wrote the following on 4/11/2005 4:02 AM:
> > Hi all,
> >
> > I don't know how to do Validation in Struts + iBatis + Dao.
> >
> > Because when I use above Structure, I must extends from BaseBean to
> > create my own Bean. As you know, if we want to use Validator of
> > Struts, our ActionForm must extends from ValidatorForm.
>
> Why do you have to extend BaseBean for your ActionForms and not
> ValidatorActionForm? I'm confused. iBATIS should care less about what
> the front end is doing so iBATIS doesn't care about your ActionForm.
> You'll have to explain more what this BaseBean is - I'm assuming it's > of
> type ActionForm? I've never needed to extend an ActionForm that I can
> recall. Actions, yes, but not ActionForms (including all the other
> flavors ValidatorActionForm, ValidatorForm, etc).
>
> --
> Rick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]





--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to