basically what i want to do is to have a validation lib that i can use for wicket and /inside/ my service layer.

right now i cannot reuse wicket validators because they are tightly bound to form components. if we decouple IValidator from FormComponent via some context interface i can take a StringValidator that we have in wicket and use it inside my service layer.

so here is an example

i have a ZipcodeValidator that validates a string to see if its a valid zipcode.

what i would like to be able to do is this:

FormComponent.add(new ZipcodeValidator());

and then in my service layer

MyUberAddressService.saveAddress(AddressBean bean) {
    ValidationContext ctx=new ValidationContext();

    new ZipcodeValidator().validate( bean.getZipcode(), ctx);
   
   if (ctx.hasError()) { throw new ValidationException(ctx); }
}

-Igor


On 9/5/06, Johan Compagner <[EMAIL PROTECTED]> wrote:


But you want to sent the FormComponent instances to the service layer? Is the service layer always on the same machine?
(if that is seperated like 1 or more Web servers that handle http load and one service server that does the db handling and so on) you have a problem
when sending over the formcomponent (that will take everything with it)

no, because validation still happens in wicket layer. i am talking about writing separate validator objects that wicket and the service layer can reuse.

So It is pure code reuse. It is not something that you all the same kind of service with both of them.

But how do you call it? What triggers the validation?
is that a FormValidatior somehow?

johan




-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
Wicket-develop mailing list
Wicket-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-develop



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-develop mailing list
Wicket-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to