Thanks very much! It works great!

regards,
Fabio

Shing Hing Man ha scritto:

If you want to skip defining an asset in the
Home.page,
you need @Asset instead of @InjectAsset :


@Asset("/img/first_2.gif")
public abstract IAsset getFirstImage();


@InjectAsset allows you to access an (specified)
asset  as a read only property.

There is some doc at http://jakarta.apache.org/tapestry/tapestry-annotations/index.html#InjectAsset

regards,
Shing

--- Fabio Bondioli <[EMAIL PROTECTED]> wrote:

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:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]




Home page :
 http://uk.geocities.com/matmsh/index.html


                
___________________________________________________________ To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to