This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Hands On Software Engineering with Python and have Brian Allbey on-line!
See this thread for details.
Win a copy of Hands On Software Engineering with Python this week in the Jython/Python 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

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: 20107
101
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.
 
This is my favorite tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!