views:

269

answers:

1
+3  Q: 

enabling el in jsp

Hi,

could anyone tell me how can I enable EL expression in JSP version 2.0? Every time I'm getting EL expression as an String literal in the JSP as an output.

Here's the DD which the container is using to sending request to servlet, and then servlet dispating request to JSP:

    <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">

    <servlet>
    <servlet-name>check</servlet-name>
    <servlet-class>Welcome</servlet-class>

    </servlet>


<servlet-mapping>
<servlet-name>check</servlet-name>
<url-pattern>/Momma.do</url-pattern>
</servlet-mapping>

</web-app>

I've not ignored any el in JSP too. Am I still missing something?

Thanks in advance.

+5  A: 

Your web.xml file looks fine for JSP 2.0. If you are having problems accessing EL on specific pages try adding the following to the top of the individual JSP page:

<%@ page isELIgnored="false" %>

Since you are using JSP 2.0 I think that EL is ignored by default so can can add the following to your web.xml to enable it for all pages:

<jsp-config>
  <jsp-property-group>
  <url-pattern>*.jsp</url-pattern>
  <el-enabled>true</scripting-enabled>
  <scripting-enabled>true</scripting-enabled>
  </jsp-property-group>
</jsp-config>
amischiefr