Amadeo,

Hi, again. If you have the images in a database, you need to retrieve them as a blob (NSData type) and you can then just hand the data to a WOImage for display. If, instead, you're storing the path to the image that's stored somewhere on a hard drive, you could just get the file at that URL path.

A resource URL is to help you get access to resources within in your project. You would use the WOResourceManager to get the correct path url and then do something with the file at that path. You can alternately ask the WOResourceManager for the bytes of the resource.

So, if you had an image as part of your project, you could do something like this:

public NSData getImageData(String imageName) {
byte[] imageBytes = WOApplication.application().resourceManager ().bytesForResourceNamed(imageName, "app", nil);
        return new NSData(imageBytes);
}

If your image was in a framework, you'd need to change "app" to the framework name.

Well, have a nice day.

Travis



On May 23, 2006, at 12:06 PM, [EMAIL PROTECTED] wrote:

Message: 6
Date: Tue, 23 May 2006 20:43:24 +0200
From: Amedeo Mantica <[EMAIL PROTECTED]>
Subject: WOResourceURL via java code
To: WebObjects Dev Apple <[email protected]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed

I have images in a database,

How to implement WOResourceURL via java code to get a string
containing the image url?

Thanks

Amedeo

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to