views:

94

answers:

2

We are trying to move our Java web application from a Tomcat 5.5 server to a more modern Tomcat 6.0.24 one, but we are having some problems with JSP EL.

The expressions placed within XML tag files are not recognized by the server, that simply renders them as text (just as in the following example). Any ideas why?

<object id="${id}"
        classid="java:${code}.class"
        type="application/x-java-applet;version=1.5"
        archive="${archive}" codebase="${codebase}"
        height="${height}" width="${width}" > 
    <param name="code" value="${code}" /> 
    <param name="codebase" value="${codebase}" /> 
    <param name="archive" value="${archive}" /> 
    <param name="type" value="application/x-java-applet;version=1.5"/> 
    <param name="mayscript" value="true" /> 

    <param name="cache_archive" value="wetorrent.jar,weupnp.jar" /> 
        <param name="cache_version" value="0.0.0.17,0.0.0.17" />    
    <strong> 
        <span style="cursor: pointer" onclick="window.open('http://www.java.com/','_blank','toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1');"&gt; 
            This browser does not have a Java Plug-in.<br /> 
            Get the latest Java Plug-in here.</span> 
    </strong> 

</object>

The weird thing is that in the JSPs that include the tag EL expression work perfectly.

I even tried setting the isELIgnored="false" attribute within the .tag file, but I got this error:

Tag directive: illegal to have multiple occurrences of isELIgnored with different values (old: true, new: false)

Where does the old (true) value come from? We never specified that.


Some other info:

The taglib is always included (in .jsp and .tag files) using <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

We put standard.jar and jstl.jar in the server's lib/ directory.

The web.xml starts with the following line:

<web-app version="2.4" 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"&gt;
A: 

Are you sure you have the JSTL 1.2 jars? You need to have that version to recognise ${foo} without the <c:out/> I think.

Ben J
This is not true. You need the `el-api` JAR file which is already in `Tomcat/lib`.
BalusC
+2  A: 

Tomcat 6.0 is a Servlet 2.5 & JSP 2.1 container. First, try using the following <web-app> start tag:

<web-app xmlns="http://java.sun.com/xml/ns/javaee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
     version="2.5">

Also, if you're using JSTL, don't install the JARs in Tomcat's lib dir, keep them in the app's WEB-INF\lib dir. By the way, as of JSP 2.0, the EL is part of JSP proper so JSTL is not required for its evaluation.

kschneid
Tried that, but it doesn't make any difference. I can't understand what sets isELIgnored to true in the first place.
abahgat
`isELIgnored` can be specified in the `tag` directive (as your original error indicates) in addition to the `page` directive. Make sure to check your JSPs and tag files.
kschneid