• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Nubie question working with dynamic images
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Nubie question working with dynamic images


  • Subject: Re: Nubie question working with dynamic images
  • From: Robert Walker <email@hidden>
  • Date: Fri, 24 Jun 2005 20:43:53 -0400

David,

I assume from this post that you are storing your images somewhere under your web server document root.

Something like:
/Library/Web Server/Documents/images

And you now want to dynamically build URLs that reference these images using a WOImage element?

Really the easiest way to figure this out is to view the source of the page in the browser window and see what gets generated as the SRC for the IMG tag.

It should look something like:

<img src="/images/myImageFile.jpg">

This will give you a relative path from the web server's document root.

Here's the tricky part: This is really all that a WOImage element does except the SRC attribute is generated by the applications WOResourceManager dynamically at runtime.

Take a look inside the bundle that gets generated for your "Web Server" target. The images are placed in a directory something like MyWOApp.woa/Contents/Resources/WebServerResources/

When WO generates a path for a specific resource it will look something like:
/WebObjects/MyWOApp.woa/Contents/Resources/WebServerResources/ myImageFile.jpg


And the IMG tag will look something like this in the HTML source:
<img src="/WebObjects/MyWOApp.woa/Contents/Resources/ WebServerResources/myImageFile.jpg">


One thing you might try is to use the "src" binding of WOImage instead of the "fileName" binding and write your own Java method to return the string representation of you image's URL.

On Jun 24, 2005, at 6:33 PM, David Green wrote:

I have looked in all the apple docs (bought WO5.2 so got the books) and searched the web and got both Joshua Marker's book and Chuck Hill's book but can't find the solution to my problem.

I have a database that contains information about images including the filenames. I can't get the images to appear in the browser. I can retrieve all the other info from the database, but I can't get the images to appear at all.

I had this working with php/mysql by inserting the filename in the src but I haven't been able to figure out the working url for the images in my development environment.

Thanks for any help.

(Oh, I'm using Tiger and WO5.3)

David Green
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mac.com


This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Nubie question working with dynamic images (From: David Green <email@hidden>)

  • Prev by Date: Re: Newbie Can't get WOToOneRelationship to work...
  • Next by Date: D2JC Form requires every attribute, regardless of what the Model or DB say
  • Previous by thread: Nubie question working with dynamic images
  • Next by thread: Re: Nubie question working with dynamic images
  • Index(es):
    • Date
    • Thread