You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Cyrille37 <cy...@gmail.com> on 2006/12/18 17:54:43 UTC

problem with InjectSpring and Field Validator

Hello,

Is that @InjectSpring syntax is correct ?

import org.apache.tapestry.form.validator.BaseValidator;
public class DocumentsUploadFileValidator
    extends BaseValidator
{
    protected ConfigurationManager configurationManager ;
    @InjectSpring("configurationManager")
    public void setConfigurationManager( ConfigurationManager 
configurationManager )
    {
        this.configurationManager = configurationManager;
    }

This code is in a class which extend 
org.apache.tapestry.form.validator.BaseValidator.
This class is instanciated like a Hivemind bean in the page specification :

    <bean name="uploadFileValidator" 
class="tap03.ui.web.validators.DocumentsUploadFileValidator" />

But when the validator runs, the property this.configurationManager is null.
There not other error in the tomcat log.


Any idea ?
Thanks
cyrille


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: problem with InjectSpring and Field Validator

Posted by Cyrille37 <cy...@gmail.com>.
Cyrille37 a écrit :
> Hello,
>
> Is that @InjectSpring syntax is correct ?
>
> import org.apache.tapestry.form.validator.BaseValidator;
> public class DocumentsUploadFileValidator
>    extends BaseValidator
> {
>    protected ConfigurationManager configurationManager ;
>    @InjectSpring("configurationManager")
>    public void setConfigurationManager( ConfigurationManager 
> configurationManager )
>    {
>        this.configurationManager = configurationManager;
>    }
>
> This code is in a class which extend 
> org.apache.tapestry.form.validator.BaseValidator.
> This class is instanciated like a Hivemind bean in the page 
> specification :
>
>    <bean name="uploadFileValidator" 
> class="tap03.ui.web.validators.DocumentsUploadFileValidator" />
>
> But when the validator runs, the property this.configurationManager is 
> null.
> There not other error in the tomcat log.
I could not make it works with annotation.

Only the page-specification works :

   <bean name="uploadFileValidator" 
class="tap03.ui.web.validators.DocumentsUploadFileValidator" >
        <set name="configurationManager" 
value="hivemind:spring:configurationManager"/>
    </bean>

Why the @InjectSpring does not works ?

Cyrille.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: problem with InjectSpring and Field Validator

Posted by Cyrille37 <cy...@gmail.com>.
Cyrille37 a écrit :
>    @InjectSpring("configurationManager")
>    public void setConfigurationManager( ConfigurationManager 
> configurationManager )
In all examples found on the Net, methods are abstract when using 
InjectSpring annotation.
It is a must have ?
Because my class could not be abstract.

cyrille


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org