Cefn Hoile <tryanotheremail@...> writes:

> 
> I've tried so many combinations and I'm now totally stuck.
> 
> Although Stripes seems perfectly well wired into my app, I cannot get the 
> core 
> functionality of Stripes to work - accepting form values over HTTP and 
checking 
> them against validation.
> 
> When testing my code, Stripes' tag library creates html inputs and populates 
> them with default values. It's loading my ActionBean on submission but 
> failing 
> to take any notice at all of the Validation annotations, either for 
> populating 
> the ActionBean from the HTML form fields, or for throwing errors when values 
> don't meet annotated requirements.
> 
> My configuration employs freemarker and stripes, and I've proven that the 
> Freemarker version of the quickstart calculator can be made to work with a 
> different web.xml.
> 
> Stripes clearly binds to my ActionBean when the form is submitted, but it is 
> failing to do any field population or validation at all and is silently 
ignoring 
> all the directives I've provided.
> 
> I can tell my @ValidationMethod is being triggered by Stripes through the 
> debugger in Eclipse. However, by inspecting the ActionBean object in the 
> stack 
I 
> can see none of the fields have been set at all from the form, all remaining 
as 
> Null, 0.0 and so on.
> 
> These values are clearly also accepted by Stripes (no errors exist in the 
> ValidationErrors object) and the Forward resolution specified in the 
> @DefaultHandler of my ActionBean class is then faithfully triggered.
> 
> What I find most confusing is that everything points to Stripes having 
correctly 
> bound my ActionBean, but it's doing nothing with form information. 
> 
> What's worse is this is a silent failure with no errors reported at all, 
despite 
> the fact that Stripes must be unable to resolve all kinds of identifiers!
> 
> There must be something I've missed, but I can't figure what. The errored 
> code 
> is at...
> 
https://github.com/cefn/makeastand.cc/tree/f0a7874b6afd6c5d46c55fe096140dfbeda05
> 5c2/makeastand.cc_jetty
> ...in case anyone has any idea.
> 
> ------------------------------------------------------------------------------
> uberSVN's rich system and user administration capabilities and model 
> configuration take the hassle out of deploying and managing Subversion and 
> the tools developers use with it. Learn more about uberSVN and get a free 
> download at:  http://p.sf.net/sfu/wandisco-dev2dev
> 

An instant fix, thankyou. 

Once the getters and setters were there everything went swimmingly. This leaves 
a couple of questions in my mind...

1) Why does the validation reference at...
http://www.stripesframework.org/display/stripes/Validation+Reference#ValidationR
eference-AnnotationDrivenValidation
...report "The annotations can be attached to either the getter or setter 
methods on the ActionBean. They can also be attached directly to the properties 
(even private ones)." 

Perhaps it's implied that getters and setters still need to be there, but the 
annotations can be elsewhere!

2) Why does Stripes fail silently in this case. It seems amazing that there 
isn't some part of the code in which a property called design is clearly found 
to be 'missing' from the point of view of Stripes and this should certainly be 
logged rather than swallowed. 

Perhaps my logging wasn't set up correctly. 

In any case, thankyou very much. I thought I was going mad.

Cefn
http://cefn.com




------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to