• Post Reply Bookmark Topic Watch Topic
  • New Topic

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: 19562
90
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.
 
I can't beleive you just said that. Now I need to calm down with this tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!