GeeCON Prague 2014*
The moose likes JSP and the fly likes EL Expressions not being evaluated Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "EL Expressions not being evaluated" Watch "EL Expressions not being evaluated" New topic
Author

EL Expressions not being evaluated

Benjamin Hundley
Ranch Hand

Joined: Mar 06, 2006
Posts: 53
I am working on a page that I didn't write and my EL expressions aren't being evaluated. They are being printed out as text in the browser. The entire page is inside a custom tag but the tld for the tag allows a body content of "JSP". Is there any other reasons EL expressions might not evaluate that I should check on?
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

What version of the JSP does your container support?
Does the heading in your web.xml file match this (ie: is servlet spec 2.4 or better)?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Benjamin Hundley
Ranch Hand

Joined: Mar 06, 2006
Posts: 53
The web container is Tomcat 5.0. It supports JSP 2.0 (looks like 2.3). I am also using Struts...
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Tomcat 5.0 supports servlet spec 2.4.

What does the top of your web.xml file look like?
Benjamin Hundley
Ranch Hand

Joined: Mar 06, 2006
Posts: 53
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">

<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410


This is a 2.3 declaration.

Try replacing it with:


Then restart your app or Tomcat and try it again.
[ May 15, 2008: Message edited by: Ben Souther ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61316
    
  66

This is covered in the JSP FAQ. Please run through it.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Benjamin Hundley
Ranch Hand

Joined: Mar 06, 2006
Posts: 53
Thank you for your help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EL Expressions not being evaluated