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
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
> > ...
> >
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
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
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
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
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;
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
--
得与失都是生活