3 Replies Latest reply on Oct 7, 2005 3:12 PM by Konstantin Novoselov

    EL in included JSP

    Konstantin Novoselov Newbie

      Hi,

      Is it possible to enable processing of EL expressions in JSPs included with PortletRequestDispatcher?

       PortletContext context = getPortletContext();
       PortletRequestDispatcher rd = context
       .getRequestDispatcher("/hello.jsp");
       rd.include(request, response);
      


      Thanks,
      Konstantin


        • 1. Re: EL in included JSP
          Jacek Laskowski Newbie

          Hi,

          I don't understand. Does it mean that your portlets with EL statements don't work in JBoss Portal? I work with 2.2.0-ALPHA and had no problems with it.

          Jacek

          • 2. Re: EL in included JSP
            Konstantin Novoselov Newbie

            I have JBoss Portal 2.0 release installed from "JBoss Portal + JBoss AS 4.0.2" bundle.

            I modified JBoss HelloWorld portlet to look like:

             public void doView(RenderRequest request, RenderResponse response) {
             response.setContentType("text/html");
            
             request.setAttribute("hello", "world");
             try {
            
             PortletContext context = getPortletContext();
             PortletRequestDispatcher rd = context
             .getRequestDispatcher("/hello.jsp");
             rd.include(request, response);
             } catch (Exception e) {
             e.printStackTrace();
             }
             }
            
            


            I am include this JSP file:

            <h3>Hello World from JSP file!</h3>
            1+1 = ${1+1}
            <br/>
            Hello attribute value: <b>${hello}</b>
            <br/>
            



            Output looks like this:
            ---

            Hello World from JSP file!

            1+1 = ${1+1}

            Hello attribute value: ${hello}

            ContextPath: ${pageContext.request.contextPath}

            ---

            As you see EL expressions aren't evaluated. Is it only me who has this problem?

            Same file accessed from plain web application produces expected result.


            Thanks,
            Konstantin



            • 3. Re: EL in included JSP
              Konstantin Novoselov Newbie

              Never mind. I solved the problem by inserting attribute version="2.4" for <web-app> tag in the web.xml