...to faces-config.xml, which I had not been doing and my .xhtml files were not being rendered, but showing the page sources always resulted in nothing (blank pages). After adding this element to faces-config.xml, I began to get a crash instead of no rendering. (I think this is an improvement?) The exception is
com.sun.facelets.tag.TagException: /guessnumber.xhtml @11,9 <h:head> Tag Library supports namespace: http://java.sun.com/jsf/html, but no tag was defined for name: head
I'm guessing I'm missing a (tag) library? I'm also concerned about mixing the wrong libraries together. (The example I'm sort of following is using Sun RI whereas I'm using MyFaces/RealFaces.
I'm trying to make the leap to using .xhtml and Facelets. I need some guidance here and would greatly appreciate any help anyone can offer.
i don't think there is a tag <h:head> ( Don't assume anything )
I would say first take any sample example code and try modifying and building new on that code
And remove below 2 jar files
I don't know anything about MyFaces. I am following SUN RI implementation and using same jar files
To make your life easier, use MyEclipse or for regular Eclispe download WTP that is tools for building and Enable JSF Capabilitues that way when you type it will prompt all the tags and attributes you jar files supports will show up
Joined: Feb 26, 2008
Yes, I'm using Eclipse Java for JEE (so, Eclipse WTP). And, yes, my Dynamic Web Project is configured for JSF 1.2--nothing else relevant is possible.
Sadly, examples of <h:head> ... </h:head> abound all over throughout many tutorials I've played with. In fact, the reason I have these elements in there is precisely because I copied and pasted them from a tutorial. This mixing of JARs is a big problem since tutorials use MyFaces or SunRI or RichFaces (and MyFaces), or PrimeFaces, or... lots of chaos.
Anyway, I excised the jstl libraries. I read somewhere that their contents were in JSF 2.0 or something like that, so they're not needed (but in the past, not having them has given me grief, maybe because I was working with pre-JSF 2.0?).
Now it's crashing more properly as it attempts to find a resource I've got (or not, as it appears).
Can you tell me...
If I have a reference
where, in fact, is this GIF really supposed to go?
I'm missing some permutations, but you probably understand where I'm going with this question. It's one of best practice as well as where it will work--where should it really go?
Joined: Apr 12, 2006
I am also only with 4 months JSF experience. Coming to your question, i have as below
and xxxxxx.png image in under /WebContent/images/xxxxx.png ( and this works fine to me )
In the past i have also tried to implement sample examples code and never could succeed and gave up. In fact, i tried so many different example source codes, that i gave up forever and never will attempt
All the examples code will be very outdated. Even if we use the same jar files that examples code used, Jar files will also be used outdated one in the examples
If you want to use examples code.............i would say use only MyEclipse source codes
i said to remove jstl libraries because, JSF came up with all these new components. we don't need those old jstl libraries and shouldn't be using those libraries when developing JSF applications
Last, before you start on the application decided on the technologies and there version and the required jar files. There are so many inter dependencies on each of them, so you can't just randomly go with your guts
Joined: Feb 26, 2008
Yes, I completely hear you. I started Facelets nearly 3 years ago and couldn't ever get anything to work, so I gave up too. However, now I need them for work, so I'm starting again. And, I've succeeded in getting my first example to work which is a great relief.
Of late, I have been working hard on defining JAR sets for JSF and Facelet work--another problem you point out. I've bettered the set of JARs I've long been using for JSF work (where I've only been doing .jsp stuff). Now, however, I need Facelets, hence beating my head against the wall (and I can't give up).
I'm not the sharpest pencil in the box, so when I am able to knock down a brick wall, I write about it. You can see what I'm doing right now if you like at http://www.javahotchocolate.com/tutorials/rf-facelets.html. I'll be cleaning this document up, making a proper tutorial of it (since, as you point out, no one else's tutorial actually works). But first, I've got to master the whole templating thing and some other stuff.
Thanks for your suggestions and help.
Joined: Apr 12, 2006
In case if you are still struggling with JAR files to include.
SUN RI and MyFaces provide different jar files. So based upon what you are using you have to download respective jar files. I THINK SO...........
As you might know JSF is just specification.
Whereas SUN RI and MyFaces are implementations.
So once you decided whether you are going with SUN RI or MyFaces, then you can download the respective jar files by googling