This will create a ContextAsset that points to your image. It's proved.
public IAsset getContextAsset(String path) {
ContextResourceLocation location = new
ContextResourceLocation(getRequestCycle()
.getRequestContext().getServlet().getServletContext(),path);
ContextAsset asset = new ContextAsset(location, new Location(location));
return asset;
}
On 6/15/05, Ron Piterman <[EMAIL PROTECTED]> wrote:
>
> Sure, components regard Assets as objects implementing IAsset. You can
> instanciate whatever implementation of this interface you wish, also
> your own, and pass it to your component:
>
> <span jwcid="@MyComponent" asset="ognl:myAsset"/>
>
> --- code ---
>
> public IAsset getMyAsset() {
> return new MyAssetImplementation(...); // or new ContextAsset(...);
> }
>
> Cheers...
> Ron
>
>
> ציטוט [EMAIL PROTECTED]:
> >
> > I have the context path for an image (i.e. images/other.jpg).
> >
> > I need to create an IAsset in code and then add it to the actual
> > component. Is that possible?
> >
> > Andy
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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]
>
>