Re: T5 How to difine dynamic path for image

2007-11-19 Thread Howard Lewis Ship
I'd just inject all three assets and choose which one to return. Injection is cheap. Maybe your situation is actually more complex. On Nov 19, 2007 5:51 PM, Doublel <[EMAIL PROTECTED]> wrote: > Yes it works well.Thanks very much > complete code : > > @Inject > private ComponentResources r

Re: T5 How to difine dynamic path for image

2007-11-19 Thread Doublel
Thanks for your feeback; I did ,it can work with this code assetSource.findAsset(null, "context:images/weathePath/" + weatherPath", null) 2007/11/20, lasitha <[EMAIL PROTECTED]>: > > On Nov 20, 2007 7:21 AM, Doublel <[EMAIL PROTECTED]> wrote: > > Yes it works well.Thanks very much > > ... > >

Re: T5 How to difine dynamic path for image

2007-11-19 Thread lasitha
On Nov 20, 2007 7:21 AM, Doublel <[EMAIL PROTECTED]> wrote: > Yes it works well.Thanks very much > ... > public void setWeatherImagePath(Asset weatherImagePath) { > this.weatherImagePath = weatherImagePath; > } > ... > public Asset getWeatherImagePath(){ > return this.assetS

Re: T5 How to difine dynamic path for image

2007-11-19 Thread Doublel
Yes it works well.Thanks very much complete code : @Inject private ComponentResources resource; @Inject private AssetSource assetSource; private Asset weatherImagePath; /** * @param weatherImagePath the weatherImagePath to set */ public void setWeatherImagePat

Re: T5 How to difine dynamic path for image

2007-11-19 Thread Josh Canfield
Injecting the asset as you've done doesn't make a lot of sense since the annotation @Path is a compile time construct. So what you are getting in your annotation is probably null, or whatever your default for weatherPath was. The advantage to using AssetResource is that you can look up assets at r

Re: T5 How to difine dynamic path for image

2007-11-19 Thread Chris Lewis
I've not seen AssetResource - what is the advantage to using it like this as opposed simply to injecting the asset? lasitha wrote: On Nov 19, 2007 2:37 PM, Doublel <[EMAIL PROTECTED]> wrote: public void onActivate(String id){ if (lw.hnSunny.equals(bc.getLogWeather())){ t

Re: T5 How to difine dynamic path for image

2007-11-19 Thread lasitha
On Nov 19, 2007 2:37 PM, Doublel <[EMAIL PROTECTED]> wrote: > public void onActivate(String id){ > if (lw.hnSunny.equals(bc.getLogWeather())){ > this.weatherPath="logweath.gif"; > ... > @Inject > @Path("context:/images/"+ weatherPath ) > private Asset trackback;

T5 How to difine dynamic path for image

2007-11-19 Thread Doublel
Hi: I have a problem I get a value from DB into private String weatherPath=""; then the code is : public void onActivate(String id){ if (lw.hnSunny.equals(bc.getLogWeather())){ this.weatherPath="logweath.gif"; } } @Inject @Path("context:/images/"+ we

T5 How to difine dynamic path for image

2007-11-19 Thread Doublel
-- 得与失都是生活