13 Replies Latest reply: Oct 4, 2012 1:54 AM by Sushant Sharma RSS

    Not getting cleared with internal working of JSF

    Sushant Sharma
      Hi All,

      I have started with basics of JSF and created some simple apps using netBeans.

      However I am not getting cleared with the exact internal working of JSF i.e. how the things are implemented in JSF libraries: jsf-api and jsf-impl.

      Please advice or share some links on this.

      --Sushant                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
        • 1. Re: Not getting cleared with internal working of JSF
          Kayaman
          Sushant Sharma wrote:
          However I am not getting cleared with the exact internal working of JSF
          I suggest you read the technical specifications regarding the different aspects of JSF, i.e. phases, scopes and such things.
          i.e. how the things are implemented in JSF libraries: jsf-api and jsf-impl.
          The jsf-api is the, well API. It's the standard that is documented in javadocs and other documents. The implementation on the other hand is something that you don't even need to know about. There are several implementations and they might do things differently, but they all adhere to the API.
          • 2. Re: Not getting cleared with internal working of JSF
            EJP
            However I am not getting cleared with the exact internal working of JSF i.e. how the things are implemented in JSF libraries: jsf-api and jsf-impl.
            You don't need to know. You only need to know that you need them both, at least until you get up to date. There is only one library now.
            • 3. Re: Not getting cleared with internal working of JSF
              Sushant Sharma
              Hi,

              For better understanding, I just want to create a custom JSF component (simply that displays 'Hello World') but without extending from any standard one. Is this possible ?

              --Sushant                                                                                                                                                                                                                                                                                                                                                                                               
              • 4. Re: Not getting cleared with internal working of JSF
                EJP
                I'm sure you have to extend UIComponent at least, but this is all covered in the documentation.
                • 5. Re: Not getting cleared with internal working of JSF
                  Sushant Sharma
                  Hi,

                  While creating JSP custom tags, we start from scratch by first creating tag handler class then .tld file for that and finally deploying both these files.

                  I am looking for a similar approach for making our own JSF component.
                  I don't want to put jsf-impl API into lib directory. Is it possible to make a simple component using jstl standard libraries ?

                  --Sushant                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                  • 6. Re: Not getting cleared with internal working of JSF
                    EJP
                    Of course not. You need the JSF implementation. Otherwise all you have is a bunch of interfaces and abstract classes. And when you update you will only have one jar file to deal with anyway. What's the aversion to JSF-impl.jar?
                    • 7. Re: Not getting cleared with internal working of JSF
                      905019
                      If you deploy to an Java EE application server such as JBoss, Glassfish etc you don't actually have to include the JSF libs as the AS already has them but it's a classloader technicality and doesn't change the way you use JSF. Google around, there are plenty of tutorials for this. JSF 2 introduced composite components also.

                      Since you're new I recommend sticking to tutorials (e.g. this oldie http://www.ibm.com/developerworks/library/j-jsf1/) since the specification is not an easy read.
                      • 8. Re: Not getting cleared with internal working of JSF
                        Kayaman
                        Nik wrote:
                        If you deploy to an Java EE application server such as JBoss, Glassfish etc you don't actually have to include the JSF libs as the AS already has them
                        Unless you're using an alternative implementation, such as MyFaces or PrimeFaces.
                        • 9. Re: Not getting cleared with internal working of JSF
                          905019
                          Primefaces is not a JSF implementation ;-)
                          • 10. Re: Not getting cleared with internal working of JSF
                            Kayaman
                            Nik wrote:
                            Primefaces is not a JSF implementation ;-)
                            Eh, indeed my bad. It's a component library.
                            • 11. Re: Not getting cleared with internal working of JSF
                              gimbal2
                              Kayaman wrote:
                              Nik wrote:
                              Primefaces is not a JSF implementation ;-)
                              Eh, indeed my bad. It's a component library.
                              That basically substitutes the entire standard JSF library, so you were not far off :)
                              • 12. Re: Not getting cleared with internal working of JSF
                                555256
                                Refer to link : http://www.theserverside.com/news/1364786/Building-Custom-JSF-UI-Components



                                -Mukul

                                Edited by: Mukul Gupta on Oct 2, 2012 6:27 PM