Re: Call spring controller from faces-config.xml

2011-11-16 Thread Ashish Kulkarni
Hi Yes when it is from jsp page, i will call Spring controller, but when from backing bean i am going to use redirect like below FacesContext fc = FacesContext.getCurrentInstance(); ExternalContext ec = fc.getExternalContext(); try{ ec.redirect(/mycontext/details.spring);

Best practices for validating an complete object/entity

2011-11-16 Thread Thomas Andraschko
Hi, i have some input fields for an entity and i want to check if the entered name does already exist. So i tried to create an BV constraint for the name property but i also need the parent entity object (for checking if the entity is transient or not). In a BV validator i can't get the the

Validating an complete object

2011-11-16 Thread Thomas Andraschko
Hi, i have some input fields for an entity and i want to check if the entered name does already exist. So i tried to create an BV constraint for the name property but i also need the parent entity object (for checking if the entity is transient or not). In a BV validator i can't get the the

Re: Validating an complete object

2011-11-16 Thread Rudy De Busscher
Hello Thomas, You need some kind of model validation, where you validate the complete class (when all proeprties are filled in). You can do it with a Bean Validation constraint (put it on the class level) or a Custom ExtVal constraint (also on class level) If you need more help, let us know.

Re: Best practices for validating an complete object/entity

2011-11-16 Thread Gerhard Petracek
hi thomas, extval as well as codi allow dependency injection in constraint-validators. - you can inject and call e.g. a service or repository or any other bean to check if a name already exists (see e.g. [1]). regards, gerhard [1]

Re: Best practices for validating an complete object/entity

2011-11-16 Thread Thomas Andraschko
Hi Gerhard, thanks for your reply. Of course but the feature i missing is: how can the #{bean.entity} be validated automatically? Because it's not binded with an inputField, it will not be automatically be validated within the Process Validations phase. Thanks, Thomas 2011/11/16 Gerhard

Re: Best practices for validating an complete object/entity

2011-11-16 Thread Gerhard Petracek
hi thomas, ok - in this case you can find the answer in the 2nd thread you opened. regards, gerhard http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2011/11/16 Thomas Andraschko

Re: Best practices for validating an complete object/entity

2011-11-16 Thread Thomas Andraschko
Hi Gerhard, all right, ok! Yep that's weird. In this mail the MAILER-DEAMON sent me an answer that my mail is spam. So i resent this mail with another title :) Sorry! Thanks! 2011/11/16 Gerhard Petracek gerhard.petra...@gmail.com hi thomas, ok - in this case you can find the answer in the

Re: Validating an complete object

2011-11-16 Thread Thomas Andraschko
Hi, So i must manually validate the object with BV and creates FacesMessages, right? Thanks! Best regards, Thomas 2011/11/16 Rudy De Busscher rdebussc...@gmail.com Hello Thomas, You need some kind of model validation, where you validate the complete class (when all proeprties are filled

Re: Validating an complete object

2011-11-16 Thread Gerhard Petracek
hi thomas, rudy is talking e.g. about @ModelValidation in [1] or AbstractAnnotationModelValidationStrategy in [2]. regards, gerhard [1]