4 Replies Latest reply on Aug 3, 2012 10:54 AM by snjv180

    JSP tags not working

    snjv180

      I think the jsp tags are not working in my application. I think so because <c:if > tags and <c:foreach> tags don't seem to work in my jsf application. I have given the namespace and all. Do I have to change anything in web.xml or anything else. It would be great if anyone can suggest a fix. Thank you.

        • 1. Re: JSP tags not working
          jhuska

          Hi Sanjeev,

           

          are you sure that you are using h:head and h:body tags in your facelets (the h prefix is important)?

          1 of 1 people found this helpful
          • 2. Re: JSP tags not working
            snjv180

            Yes,

            I have added the <h:head> tags . I think it is due to the difference in scopes or jstl and jsf. I think I am gonna try an example tomorrow and see if that works. Thank you for the reply!!!

            • 3. Re: JSP tags not working
              mcmurdosound

              Are you using jsf 1.2 with facelets or jsf with jsp?

               

              if you are using facelets, you can use the jstl tags (like c:if or c:forEach) but be aware, that they will change the component tree while rendering the response (buildView before renderView) and that the usage can cause strange sideeffects:

              - the "var" attribute of a a4j:repeat for example is not available during the c:if test evaluation

              - the condition for c:if test is evaluated on every request. So if there is too much or expensive logic, this could cause performance issues. Especially if you are firing queries to your database.

              - c:forEach may create lots and lots of UIComponents in the component tree.

              • 4. Re: JSP tags not working
                snjv180

                Hello,

                     I'm working with JSF 2.0. Thank you for the very very helpful explanation. Can I have a guide for how to use them together in harmony with each other. Could you provide me a link. Anyways this was the answer I was looking for. This solved th issues I was having

                 

                http://stackoverflow.com/questions/7593603/jstl-xmlns-namespace-differences-between-jsf-1-2-and-jsf-2-x

                1 of 1 people found this helpful