You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Keith Hankin <ke...@addr.com> on 2004/06/05 12:47:07 UTC
Using EL
I have a very simple JSP page that attempts to output the value of a
variable using EL "${var}" notation. However, it is just printing the
"${var}" literally. I am using Tomcat 5.0.19, and according to the JSP spec,
since this supports 2.4 servlet spec, it should support EL by default.
Anyhow, I tried adding:
<% page isELIgnored="false" %>
to the beginning of the page, but then I get the following error:
According to TLD or attribute directive in tag file, attribute value
does not accept expressions.
However, I do not have any TLD or tag file for this JSP file.
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
EL not processed by default with Tomcat 5.0.19
Posted by Keith Hankin <ke...@addr.com>.
Here's my page:
<html><body>
<% pageContext.getRequest().setAttribute("name", "hello world"); %>
Name: ${name}
</body></html>
This prints "Name: ${name}". According to the JSP spec, with Servlet
containers supporting 2.4, EL should be processed by default, but it isn't
being done. So I added the following to my web.xml:
<jsp-config>
<url-pattern>*.jsp</url-pattern>
<el-ignored>false</el-ignored>
</jsp-config>
This seems to be ignored, as I am still getting the same incorrect output.
Only if I add the following at the top of each page, does it work: <%@ page
isELIgnored="false" %>
Is there any way I can get this to work without having to have this
declaration at the top of every page?
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Using EL
Posted by Mark Lowe <ma...@boxstuff.com>.
I still use the 2.3 spec for my web.xml but i think you need something
like this to activate it
<jsp-config>
<url-pattern>*.jsp</url-pattern>
<el-ignored>false</el-ignored>
</jsp-config>
The dtd should be able to show you where it should go (i.e in what
order).
On 5 Jun 2004, at 14:22, Keith Hankin wrote:
> Sorry, copy error. I *did* specify <%@page isELIgnored="false" %>
> That is why I got the error message I did.
>
> ----- Original Message -----
> From: "Mark Lowe" <ma...@boxstuff.com>
> To: "Tomcat Users List" <to...@jakarta.apache.org>
> Sent: Saturday, June 05, 2004 5:29 PM
> Subject: Re: Using EL
>
>
>> Try
>>
>> <%@ page isELIgnored="false" %>
>>
>> not
>>
>> <% page isELIgnored="false" %>
>>
>> The tlds are in the jar files no need to have the tld's like
>> traditional taglibs
>>
>> The below in your jsp should do the job.
>> <%@ page isELIgnored="false" %>
>> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
>> <c:set var="test" value="Mellow world!!" />
>> ${test}
>>
>>
>> HTH Mark
>>
>> On 5 Jun 2004, at 12:47, Keith Hankin wrote:
>>
>>> I have a very simple JSP page that attempts to output the value of a
>>> variable using EL "${var}" notation. However, it is just printing the
>>> "${var}" literally. I am using Tomcat 5.0.19, and according to the
>>> JSP
>>> spec,
>>> since this supports 2.4 servlet spec, it should support EL by
>>> default.
>>> Anyhow, I tried adding:
>>> <% page isELIgnored="false" %>
>>> to the beginning of the page, but then I get the following error:
>>>
>>> According to TLD or attribute directive in tag file, attribute
>>> value
>>> does not accept expressions.
>>>
>>> However, I do not have any TLD or tag file for this JSP file.
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Using EL
Posted by Keith Hankin <ke...@addr.com>.
Sorry, copy error. I *did* specify <%@page isELIgnored="false" %>
That is why I got the error message I did.
----- Original Message -----
From: "Mark Lowe" <ma...@boxstuff.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Saturday, June 05, 2004 5:29 PM
Subject: Re: Using EL
> Try
>
> <%@ page isELIgnored="false" %>
>
> not
>
> <% page isELIgnored="false" %>
>
> The tlds are in the jar files no need to have the tld's like
> traditional taglibs
>
> The below in your jsp should do the job.
> <%@ page isELIgnored="false" %>
> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
> <c:set var="test" value="Mellow world!!" />
> ${test}
>
>
> HTH Mark
>
> On 5 Jun 2004, at 12:47, Keith Hankin wrote:
>
> > I have a very simple JSP page that attempts to output the value of a
> > variable using EL "${var}" notation. However, it is just printing the
> > "${var}" literally. I am using Tomcat 5.0.19, and according to the JSP
> > spec,
> > since this supports 2.4 servlet spec, it should support EL by default.
> > Anyhow, I tried adding:
> > <% page isELIgnored="false" %>
> > to the beginning of the page, but then I get the following error:
> >
> > According to TLD or attribute directive in tag file, attribute
> > value
> > does not accept expressions.
> >
> > However, I do not have any TLD or tag file for this JSP file.
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Using EL
Posted by Mark Lowe <ma...@boxstuff.com>.
Try
<%@ page isELIgnored="false" %>
not
<% page isELIgnored="false" %>
The tlds are in the jar files no need to have the tld's like
traditional taglibs
The below in your jsp should do the job.
<%@ page isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set var="test" value="Mellow world!!" />
${test}
HTH Mark
On 5 Jun 2004, at 12:47, Keith Hankin wrote:
> I have a very simple JSP page that attempts to output the value of a
> variable using EL "${var}" notation. However, it is just printing the
> "${var}" literally. I am using Tomcat 5.0.19, and according to the JSP
> spec,
> since this supports 2.4 servlet spec, it should support EL by default.
> Anyhow, I tried adding:
> <% page isELIgnored="false" %>
> to the beginning of the page, but then I get the following error:
>
> According to TLD or attribute directive in tag file, attribute
> value
> does not accept expressions.
>
> However, I do not have any TLD or tag file for this JSP file.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org