You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Georg Lackermair <g....@isys-software.de> on 2010/11/09 13:15:02 UTC

EL works in JSP but not in tag files

Hello everyone,

The problem is that EL expressions work well in JSPs, but get ignored in
custom tags. i found several related posts on the web, but none helped
me to solve this. On adding the line
<%@ tag isELIgnored="false" %> i get the following error message:

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

The tag file starts like this:

<%@ tag isELIgnored="false" %>
<%@ tag import="..."%>
<%@ tag import="..." %>
<%@ tag import="..."%>
<%@ tag import="..." %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>

<%@ attribute name="article" required="true" type="..."%>
<%@ attribute name="suggestedQuantity" required="true"
type="java.lang.Integer"%>
<%@ taglib uri="/tags" prefix="pref" %>

Our web.xml starts with the following lines:

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

I guess it is just some configuration issue, but i can't figure out what
the problem could be (maybe growing frustration prevents me from seeing
clearly). The error occured on tomcat 6.0.29 and
  tomcat 7.0.2. Hope that somebody could help me here.

Thanks in advance!

Cheers,

Georg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: EL works in JSP but not in tag files

Posted by Georg Lackermair <g....@isys-software.de>.
Oh, this is embarrassing! Mark, thanks so much for the hint. The TLD 
begins with

<taglib 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/web-jsptaglibrary_2_0.xsd"
	version="2.0">
	<tlib-version>1.0</tlib-version>
	<jsp-version>1.2</jsp-version>

which is obviously not correct. I set tlib-version to 1.2 and
jsp-version to 2.1. This solved it!

Cheers,

Georg



>
> Tag files are always part of tag libraries - whether or not you define
> an explicit TLD.
>
> Tag libraries have a default JSP version that is not the same as the
> servlet spec version defined in the web app.
>
> Best guess: the default version is a JSP version that doesn't support
> the EL you are trying to use. Tomcat recently got a lot stricter about
> this in order to fix a handful of EL related bugs.
>
> Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: EL works in JSP but not in tag files

Posted by Mark Thomas <ma...@apache.org>.
On 09/11/2010 12:15, Georg Lackermair wrote:
> 
> Hello everyone,
> 
> The problem is that EL expressions work well in JSPs, but get ignored in
> custom tags. i found several related posts on the web, but none helped
> me to solve this.

Tag files are always part of tag libraries - whether or not you define
an explicit TLD.

Tag libraries have a default JSP version that is not the same as the
servlet spec version defined in the web app.

Best guess: the default version is a JSP version that doesn't support
the EL you are trying to use. Tomcat recently got a lot stricter about
this in order to fix a handful of EL related bugs.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org