I correct myself. The validation didn't appear to get called because the flag wasn't set and there were xml errors in validation.xml. My bad. Though we are still getting strange exceptions....so it's not working for us (yet).

Best,
Michelle

Michelle Harris wrote:
I too haven't been able to get server-side validation to work. Although I have been using a different release. When I use validator-1.0 from dwinterfeldt's site, using server side validation results in nothing being validated as described in Bens Kwable message.
Thanks,
Michelle Harris

-----Original Message----- From: Kwabla, Bens [mailto:[EMAIL PROTECTED]] Sent: Mon 12/16/2002 07:13 To: 'Struts Users Mailing List' Cc: Subject: Struts validating with beta2 not working for server-side validation



Hi All!

When I switch from client-side to server-side validation, the validation is
not effected. Now I called super.validate(..) in the validate(..) method of
my formbean (derived from ValidatorForm) and logged out errors.size() which
turned out to be 0, apparently indicating that my errors Object is empty. I
further checked the ValidatorForm.validate(..) method of the latest nightly
build and saw this code...

public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {

ServletContext application = getServlet().getServletContext();
ActionErrors errors = new ActionErrors();

Validator validator =
Resources.initValidator(mapping.getAttribute(),
this,
application, request,
errors, page);

try {
validatorResults = validator.validate();
} catch (ValidatorException e) {
log.error(e.getMessage(), e);
}

return errors;
}
What I don't understand is the errors Object is returned, but I don't see
when it is filled with the validation results. Is it likely there is a bug
in here?


-----Ursprüngliche Nachricht-----
Von: David Graham [mailto:[EMAIL PROTECTED]]
Gesendet: Freitag, 13. Dezember 2002 18:43
An: [EMAIL PROTECTED]
Betreff: Re: Struts validating with beta2 not working


You need to tell us exactly what "not working" means. Did you replace all
the jars in WEB_INF/lib with the new ones for beta 2?

David






>From: "Kwabla, Bens" <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
>Subject: Struts validating with beta2 not working
>Date: Fri, 13 Dec 2002 14:40:30 +0100
>
>Hi All!
>
>I had the client-side validation working under struts version before the
>beta 2. Now my application has been migrated to the beta 2 of struts. Since
>then, my client-side validation is no longer working. I understand the
>validating logic has been adopted into commons. Can some tell me what is
>happening?
>
>Bens Kwabla
>
>-----Ursprüngliche Nachricht-----
>Von: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED]]
>Gesendet: Freitag, 13. Dezember 2002 14:35
>An: [EMAIL PROTECTED]; [EMAIL PROTECTED]
>Betreff: RE: Re: OptionsCollection
>
>
>Hi,
>There are many ways of doing this.So first is as the collection is being
>displayed on screen,make it an attribute of form and popolate it in action
>on
>form.So in jsp u will access like a form attribute.
>
>But the problem with this approach is If u get an error and forward back
>the
>
>user to same jsp, u loose the collection data as u are directly going to
>the
>
>screen.So the solution could be have a generic action which will be called
>in
>case of errors and the action will populate form with list before
>forwarding
>it
>to same jsp.
>
>Else U can have lazy in itialising forms.i.e forms getList emthod itself
>will
>call service to get data if list is null.And then in this case ,u can just
>use
>an epty action class which does nothing but forwarsd to "success" which is
>the
>origicnal jsp.But this action will be mapped with the Original actions form
>so
>that the form will use its auto population mechanism to get the list..But i
>dont like this approach ..just not a good design i think.But very
>conveninent.
>
>
>Hope this helps,
>Regards,
>Shirish
>
>-----Original Message-----
>From: marklowe [mailto:[EMAIL PROTECTED]]
>Sent: Friday, December 13, 2002 12:12 PM
>To: struts-user
>Cc: marklowe
>Subject: Re: OptionsCollection
>
>
>Okay... But a drop down menu is screen data.
>
>And a list of companies is something that will be used more than once.
>
>So I have a normal class in my model layer
>
>ListCompanies
>
>In my UserAction
>
>(ListCompanies).getCompanies();
>
>But this Action's primary job is to return a list of users (which it does).
>
>As the list is screen data i should be defining this in my form bean? This
>is something thats being confusing me for weeks. If i've a bunch of
>collections how can i make them available to iterate tags and select menus,
>without using useBean (sorry silly design constraint, but beyond my
>control).
>
>Hopefully I'm just being silly, i could really do with some pointers as
>where i'm missing the point.
>
>Cheers mark
>
>
>On 13-12-2002 11:49, "[EMAIL PROTECTED]"
><[EMAIL PROTECTED]> wrote:
>
> > Also i dont understand why u need to access the request directly.I mean
>why
> > are
> > u setting all the collections as request attributes.GEnerally I think
>the
>good
> > design is when u r FormBEan represents the screen data.So in this case
> > whatever
> > u need on screen will become attribute of form.
> > I know it does not make much difference in implemantation but as a
>design
>it
> > becomes pretty straight forward.I mean for an action , if u just look at
>the
> > form, u know what is being displayed.So u just populate the form in
>action.
> >
> > Any comments... :-))
> >
> >
> > -----Original Message-----
> > From: VEDRE [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, December 13, 2002 11:44 AM
> > To: struts-user
> > Cc: VEDRE
> > Subject: RE: OptionsCollection
> >
> >
> > You can either use attribute collection="users" for options tag if you
>store
> > in request
> > or you can use name="formName" property="myList" if you
>have
> > a getMyList() method for the form(You have to fill call
>formName.setMyList()
> > in your action class before forwarding to a jsp).
> >
> >
> > checkout
>http://jakarta.apache.org/struts/userGuide/struts-html.html#options
> > if you have not looked at the documentation.
> >
> > -rana.
> >
> >
> > -----Original Message-----
> > From: Mark [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, December 13, 2002 5:36 AM
> > To: Struts Users Mailing List
> > Subject: OptionsCollection
> >
> >
> > Hello
> >
> > I've a number of collections already defined that end up being passed to
>my
> > jsp's via the request object.
> >
> > Users in this case is a map defined in my business logic class that does
>db
> > queries.
> >
> > users = (ListUsers).getUsers();
> >
> > request.setAttribute("users",users);
> >
> >
> > I itertate through this collection using iterate. But now i want to use
>this
> > in a select menu.
> >
> > Should I be thinking about making my collection available to my FormBean
>i.e
> > making a getMyList() method.
> >
> > Thanks in advance
> >
> > mark
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> >
> > --
> > To unsubscribe, e-mail:
><mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
><mailto:[EMAIL PROTECTED]>
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
><mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
><mailto:[EMAIL PROTECTED]>
> >
> >
>
>
>--
>To unsubscribe, e-mail:
><mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail:
><mailto:[EMAIL PROTECTED]>
>
>
>
>--
>To unsubscribe, e-mail:
><mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail:
><mailto:[EMAIL PROTECTED]>
>
>--
>To unsubscribe, e-mail: ><mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail:
><mailto:[EMAIL PROTECTED]>


_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


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

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





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

Reply via email to