This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

img in h:commandLink does not render in jsf page  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have 2 h:form and the same image button in both of them... the button does not render in either of them!

On inspect element -> Console: it shows this:

Failed to load resource: the server responded with a status of 404 (Not Found)

The image does exist in the specified path.

I have the same commandLink in another jsf page... it renders there fine!

Here's the code:
 
Bartender
Posts: 19725
92
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, since the example code you posted has an tag with absolutely no attributes, I'd say that not rendering would be what we'd expect. After all, how can you render an image when you haven't said what the image is?

More generally, my first suspicion would be that you had failed to code the correct image path.

Note, however, that JSF has an image tag of its own (<h:graphicImage>) and that's what I would usually recommend using.

In fact, I really don't recommend putting any raw HTML in a JSF View Template. There's almost always a JSF equivalent which knows more about the JSF environment and helps preserve one of JSF's original design intentions - that View Rendering should be portable and not limited only to HTML.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!