5 Replies Latest reply on Oct 19, 2006 10:16 AM by peterj

    EL does not get picked up

    angbellavia

      I'm trying to use EL statements within my pages and it seems to just pick it up as template data.

      If I have:

      ${...} where '...' is some expression, it will just print ${...}

      It does not evaluate my EL statements. I know that EL statements are on by default so that can't be the problem. Any ideas?

        • 1. Re: EL does not get picked up
          peterj

          Make sure you are using the correct setting in your web.xml file. To use EL, you should have:

          <web-app
           xmlns="http://java.sun.com/xml/ns/j2ee"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
           http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
           version="2.4">



          • 2. Re: EL does not get picked up
            angbellavia

            Yes,

            I am doing that. It still does not work.

            • 3. Re: EL does not get picked up
              peterj

              I guess that I would need to see some of your code. Could you post a simple jsp that doesn't work?

              • 4. Re: EL does not get picked up
                angbellavia

                Here is a JSP from an example I'm reading from a book that does'nt work on my systesm:

                <%@ page import="java.util.*" %>

                Topic Questions

                <h1>Topic Questions</h1>
                <jsp:useBean id="questions" class="com.apress.faq.Questions">
                <jsp:setProperty name="questions" property="topic" />
                </jsp:useBean>
                The number of questions in topic ${questions.topic} is ${questions.numQuestions}
                <%
                Map topic = questions.getQuestions();
                Iterator keys = topic.keySet().iterator();
                while (keys.hasNext()) {
                String key = (String) keys.next();
                pageContext.setAttribute("key", key);
                %>
                Question
                ${key}:
                ${questions.questions[key]}
                <%
                }
                %>

                • 5. Re: EL does not get picked up
                  peterj

                  Sorry, but when I use EL I always pass a bean from my servlet and use it directly, I don't use jsp:useBean. I could, of course, try out your JSP and see if I get it working, unfortunately I am a little swamped right now. I could try some time next week, or maybe some other kind soul could help.