This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSF and the fly likes JSF dynamic image Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF dynamic image" Watch "JSF dynamic image" New topic
Author

JSF dynamic image

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15950
    
  19

Could anyone supply an example in JSF of how I'd code an image tage with a complex dynamic URL? I need to reference dynamically generated images and I'm going round and round with it.

The resulting URL should look something like:

<img src="http://relocated.url.com/mywebapp/image-generator?imagenumber=123">

where the "123" is a JSF property value and the URL as a whole is mapped a la the JSTL c:url tag.


Customer surveys are for companies who didn't pay proper attention to begin with.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15950
    
  19

Crud. I posted this in the wrong browser frame. Mark, can you move this to the JSF forum? Thanks!
Varun Khanna
Ranch Hand

Joined: May 30, 2002
Posts: 1400
You can use h:graphicImage tag and map the url or value attribute to the backing bean's property.
Tag's specs.


- Varun
Mark Herschberg
Sheriff

Joined: Dec 04, 2000
Posts: 6037
So moved...
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15950
    
  19

OK, That's not as convoluted as what I was thinking, but it works.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JSF dynamic image
 
Similar Threads
Rewrite URLs
* Welcome Ed Burns & Chris Schalk
Dynamic Data Display in JSF
wacht a camera with JSF2.0
Loading image file