You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Rob Dennett <ro...@tmit1.org> on 2005/09/13 17:41:48 UTC

@InjectState vs.

When should you use the @InjectState annotation vs. the <inject> tag?  Is it just a matter of whether you are using Java 1.5 or not?  I have an Insert component that is being bound to a property that is not declared in the page spec.  Instead, I have abstract accessors in the Java class with the getter preceded by @InjectState.  Tapestry pukes when it reaches the parameter binding for the component, saying that it doesn’t know what property I am talking about.  Adding a property definition to the spec complains that the property name is being used twice.  What do you need to do to access an injected property in a specification?

 

Thanks in advance,

Rob


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.10.21/96 - Release Date: 9/10/2005
 

Re: @InjectState vs.

Posted by Howard Lewis Ship <hl...@gmail.com>.
Use @InjectState when you can (when you have JDK 1.5).

I suspect your problem is due to an unusual property name; an eariler
poster had a problem with a method named getJFreeChart(); the name of
the corresponding property is "JFreeChart" not "jFreeChart" ... this
is due to JavaBeans framework naming conventions, as specified by Sun.
Is your property name causing similar problems?

On 9/13/05, Rob Dennett <ro...@tmit1.org> wrote:
> When should you use the @InjectState annotation vs. the <inject> tag?  Is it just a matter of whether you are using Java 1.5 or not?  I have an Insert component that is being bound to a property that is not declared in the page spec.  Instead, I have abstract accessors in the Java class with the getter preceded by @InjectState.  Tapestry pukes when it reaches the parameter binding for the component, saying that it doesn't know what property I am talking about.  Adding a property definition to the spec complains that the property name is being used twice.  What do you need to do to access an injected property in a specification?
> 
> 
> 
> Thanks in advance,
> 
> Rob
> 
> 
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.344 / Virus Database: 267.10.21/96 - Release Date: 9/10/2005
> 
> 
> 


-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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