It depends on the approach you want to take in validation.

For security reasons we run two layers of validation, a simple model using
jQuery checking mandatory fields and limits checks and then a more rigorous
model server side.

As for setting up, we looked at how it was done with S2 and dojo, in the end
we found it it much easier just to program directly when creating the form
pages. Because of the powerful selectors  in jQuery and judicious use of
listeners we¹ve had no issue with maintenance of code and we¹ve been able to
leverage a range of plugins available for jQuery.

Originally we tried to have the scripts created automagically through
programming, but in the end it wasn¹t worth the effort. We¹ve extended the
CSS and XHTML templates to accommodate some time saving features but on the
whole there wasn¹t much to it.

I now find it quicker to setup the validation directly rather than setting
up the XML files. It¹s amazing what can be achieved with a few well placed
s:if tags and some JS code.

Z.

> 
> Hi Zoran,
> 
> Thank you for your answer. Since you are using JQuery directly, how do you
> perform data validation ? Is it possible to use the XML Files or annotations
> provided by Struts ?
> 
> Cheers,
> 
> Nicolas
> 
> On Tue, Jul 28, 2009 at 11:26 AM, Zoran Avtarovski
> <zo...@sparecreative.com>wrote:
> 
>> > From what I can tell Dojo has been moved out into a plugin, but still
>> > exists.
>> >
>> > Honestly though, I¹d take the opportunity move away from an integrated
>> > solution to using a javascript framework directly.
>> >
>> > We use jQuery and it integrates with Struts without any major issues and
>> > more often than not offers much greater flexibility. I know of others who
>> > use dojo, mootools and prototype without any issues.
>> >
>> > Z.
>>> > >
>>> > > Hi everybody,
>>> > >
>>> > > I'm currently working on a project based on Struts 2.0.11. We're
>>> planning
>> > to
>>> > > migrate to the last 2.1.x version but I've just seen that the Dojo
>>> plugin
>>> > > has been deprecating. Consequently, what's your recommandation to
>>> perform
>>> > > proper AJAX validation since the example on the Wiki is still based on
>> > the
>>> > > Dojo plugin ? Which plugin will be the next standard for Ajax tags in
>> > Struts
>>> > > 2 ? JQuery plugin ?
>>> > >
>>> > > Thanks in advance for your answers,
>>> > >
>>> > > Regards,
>>> > >
>>> > > Nicolas
>> >
>> >
>> >
> 


Reply via email to