• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

img in h:commandLink does not render in jsf page

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic