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?
The default mode for JSP pages delivered using a descriptor from Servlet 2.3 or before is to ignore EL expressions; this provides backward compatibility.
Expression Language (EL) in JSP The Expression Language (EL) simplifies the accessibility of data stored in the Java Bean component, and other objects like request, session, application etc. There are many implicit objects, operators and reserve words in EL. It is the newly added feature in JSP technology version 2.0.
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 you 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</el-enabled>
<scripting-enabled>true</scripting-enabled>
</jsp-property-group>
</jsp-config>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With