5 Replies Latest reply on Apr 18, 2010 3:42 AM by asafz

    JSP 2.1 unified EL support for jboss 5.0.1

    asafz

      I'm using jboss 5.0.1 with jsf + tiles + jsp

       

      I wanted to get advantage of the unified EL so I could use JSTL tags like c:foreach with jsf #{} expressions.

      further more I wanted to use the jsf EL #{...} outside of a jsf tag in the same way that ${..} is working.

       

      From the jsp 2.1 documentation looks like this should work just fine. but it is not working for me.

      I'm getting exceptions that #{..} can not be used outside a jsf tag and I'm getting exceptions that #{..} can not be used as a parameter to c:foreach

       

      Does it suppose to work for jboss 5.0.1? Does the JSP 2.1 support is enabled by default?

      What am I doing wrong?

       

      BTW - my fallback will be to use facelets insead of JSP but I prefer not to go to that direction at the current project state.

        • 1. Re: JSP 2.1 unified EL support for jboss 5.0.1
          ssilvert

          Yes, Unified EL works on JBoss AS 5.0.1.  You can take a look at the WAR that I attached to @PostConstruct annotation not called jboss5.1 a few minutes ago.  It tests Unified EL.

           

          One thing you need to be careful of is the deployment descriptor on web.xml and faces-config.xml.  Make sure you have the right version.  The one I have for faces-config.xml is actually for JSF 2.0 but /index.jsf will still work on AS 5.0.1.  You should use the descriptor for JSF 1.2.

           

          Stan

          • 2. Re: JSP 2.1 unified EL support for jboss 5.0.1
            asafz

            Thanks for the reply,

             

            I saw the c:foreach and the use of #{..} vars I will give it a try.

             

            Do you know if JSP2.1 supports putting #{..} outside of a jsf tag like you can do for ${..}?

             

            e.g.

            <body>

                 <f:view>

                      <h:form>

                           member: #{mybean.member}

                      </h:form>

              </f:view>

            </body>

             

            Is this a valid syntax for jsp2.1? is it valid for facelets?

            • 3. Re: JSP 2.1 unified EL support for jboss 5.0.1
              ssilvert

              I don't remember.  Just try it.  But I see no advantage in using #{} over ${} in that situation.

               

              Stan

              • 4. Re: JSP 2.1 unified EL support for jboss 5.0.1
                asafz

                The question is if looping using c:foreach using jsf el #{..} and then printing the iterated var inside the loop using ${..} will work...

                 

                I'm not sure but I need to test it.

                • 5. Re: JSP 2.1 unified EL support for jboss 5.0.1
                  asafz

                  Well I found my problem,

                   

                  I included jstl 1.1 jar in my server lib directory, this is why c:foreach did not work with #{..} vars.

                  After removing this jar everything is working just fine.

                   

                  Stan, thank you for the all the help. the example code was very helpfull.