tapestry-user@jakarta.apache.org
[Top] [All Lists]

Problem with @InjectAsset:

Subject: Problem with @InjectAsset:
From: Fabio Bondioli
Date: Tue, 04 Apr 2006 12:11:57 +0200
Hi,

I've some trouble in accessing asset using @IjectAsset annotation. I would like to use this method so I can skip the Home.page at all.

In my Home.java I've declared my asset this way:

public abstract class Home extends BasePage {
@InjectAsset("context:/img/first_2.gif")
   public abstract IAsset getFirstImage();

...
...


Then in my Home.html I'm trying to access this asset this way:
<img jwcid="@Image" image="asset:firstImage" src="img/first_2.gif" border="0" />

I get this error: Component Home does not contain an asset named 'firstImage'.

I've tried also this way:
<img jwcid="@Image" image="ognl:getFirstImage()" src="img/first_2.gif" border="0" />

but I get a differnt Error: Value for parameter 'image' in component Home/$Image is null, and a non-null value is required.


It works great if I use <asset> in Home.page specification file but I would like to use the Annotation way.

Where is my fault?

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: tapestry-user-help@xxxxxxxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>