I was working on a web application, and was trying to access a parameter using EL (Expression Language) in my JSP.
I googled it, and found out, that it should work with JSP 2.0 without including any tag library (JSTL core).
But it was not..
So here are few things you can check…
- Application server in question doesn’t support JSP 2.0.
- The web.xml is not declared as Servlet 2.4 or higher.
- The @page is configured with
- The web.xml is configured with
I found out the problem with web.xml declaration. Although it was declared as Servlet 2.5, but it was not working. As Tomcat 5.5 does not support servlet 2.5, but tomcat 6 does.
So i changed it to
<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"> <!-- XML Code --> </web-app>
And it worked perfectly fine.
If your problem does not go away by adding servlet 2.4, check if you have configured
<el-ignored> tag in
<jsp-config> as below.. if you have, than change it to false, or remove
<el-ignored> tag entry.
if EL is still not working than check out your jsp page, whether its configured with
isELIgnored=true, if yes, set it to false.