Application Server Solutions for Microsoft IIS and ASP.NET
       solutions   products   partners   company   support   downloads         store
View Interest List Message Details
<< Back to Search Results

Date: 06/08/2006
From: matt@newatlanta.com
Subject: Re: [ServletExec] JSTL 1.0 and Servlet 2.4
John,
If your web.xml specifies Servlet Spec. 2.4,(or newer) then any EL on a 
JSP page is evaluated by SE's JspEngine.
If your web.xml specifies Servlet Spec. 2.3 (or older)  then any EL on a 
JSP page is NOT evaluated by SE's JspEngine.

If such EL is used as the value of an attribute of a JSTL (or custom) 
tag then SE will pass the EL to the tag.

"passing the EL to the tag" means different things depending on       
whether 
the app is 2.4 or 2.3:

 1. for 2.4, SE will pass the evaluated EL string to the tag.
    (this is treated as a runtime expression as far as the tag is 
concerned)

 2. for SE 2.3, SE will pass the UN-evaluated EL string to the tag.

Whether or not the tag can evaluate an UN-evaluated EL construct, or 
whether or not it can accept a runtime expression depends on the tag 
(and the TLD where it is defined).

With JSTL 1.0, there are 2 categories of tag libraries:
 - EL-based
 - runtime-based

Please see section 7.4 of the SE 4.2 User Guide for more details about 
those 2 categories.
I can add here that the EL-based TLDs defined in JSTL 1.0 can handle 
UN-evaluated EL, but cannot handle runtime expressions (i.e. they cannot 
handle EL that SE has already evaluated).


With JSTL 1.1, there is only one set of tag libraries (no longer 2 
"categories").
The JSTL 1.1 tags do NOT take care of evaluating the EL... the JSP 
Engine is supposed to handle EL in those cases.
This means that to use JSTL 1.1 tags, and use EL as the value of 
attributes of those tags, a person would have to use a Servlet 2.4 
webapp, running inside a Servlet/JSP Engine that supports Servlet 2.4.

When I setup your example as you described it fails for me too, and I'd 
expect that.
I can make it work if I just change:

<%@taglib prefix="c"                                               
uri="http://java.sun.com/jstl/core"%>

to be a either:

<%@ taglib uri="http://java.sun.com/jsp/jstl/core"                 
prefix="c" %>

-or-

<%@ taglib uri="http://java.sun.com/jstl/core_rt"                  
prefix="c" %>


both of which are TLDs that accept runtime expression values.

Hope that helps.


Matt McGinty
Software Engineer
New Atlanta Communications, LLC
http://www.newatlanta.com 



John Fletcher wrote:

>I have identical web applications on two separate servers, both running
>ServletExec 5.0 with the latest (May 2006) hotfix.  Both web
>applications use JSTL 1.0 tag libraries.  One is on Java 1.4.2, the
>other on Java 1.5.  The web application running Java 1.5 has a Servlet
>2.4 declaration in the web.xml, the other will not work unless I use a
>Servlet 2.3 declaration.  The error I get when using a Servlet 2.4
>declaration is:
>
>"attribute value cannot have a request time expression value"
>
>I get this error in the ServletExec logs when I try to run the following
>jsp:
>
><%@taglib prefix="c"                                           
uri="http://java.sun.com/jstl/core"%>
><c:set var="myName" value="john"/>
><c:out value="${myName}"/>
>
>That convoluted introduction leads me to my two questions:
>
>1. Is JSTL 1.0 / Servlet 2.4 a supported configuration in ServletExec?
>2. How does ServletExec's processing of JSTL differ when inside a
>Servlet 2.3 webapp as opposed to a Servlet 2.4 webapp?  The most
>confusing thing for me is that the Servlet 2.4 / JSTL 1.0 setup works on
>the other machine (in fact, there are others as well on the network with
>slightly different web application configurations which also work with
>the Servlet 2.4 / JSTL 1.0 setup).  I can't help but think there       
_must_
>be some difference in the configuration of the applications, I just
>can't determine what that difference might be.
>
>Thanks for the help.
>
>John Fletcher
>Latitude Geographics Group Ltd.
>jfletcher@latitudegeo.com www.latitudegeo.com
>Head Office: 204 Market Square Victoria, BC Canada V8W 3C6
>Tel: (250) 381-8130 Fax: (250) 381-8132 
>
>Geocortex Internet Mapping (www.geocortex.net) - Helping people succeed
>with web-based geography
>
>
>-------------------------------------------------------------------------
>ServletExec-Interest. For archives and unsubscribe instructions, visit:
>
>    http://www.newatlanta.com/servletexec-interest.jsp
>  
>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
 <meta content="text/html;charset=ISO-8859-1"                      
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<font face="Verdana">John,<br>
If your web.xml specifies Servlet Spec. 2.4,(or newer) then any EL on a
JSP page is evaluated by SE's JspEngine.<br>
</font><font face="Verdana">If your web.xml specifies     
Servlet Spec. 2.3
(or older)&nbsp; then any EL on a JSP page is NOT evaluated by SE's
JspEngine.</font><br>
<font face="Verdana"><br>
If such EL is used as the value of an attribute of a JSTL (or custom)
tag then SE will pass the EL to the tag.<br>
<br>
"passing the EL to the tag" means different things depending on       
whether
the app is 2.4 or 2.3:<br>
<br>
&nbsp; 1. for 2.4, </font><font face="Verdana">SE     
will pass the evaluated
EL string to the tag.<br>
&nbsp;&nbsp;&nbsp;&nbsp; (this is treated as a runtime          
expression as far as the tag is
concerned)</font><br>
<font face="Verdana"><br>
&nbsp; 2. for SE 2.3, </font><font face="Verdana">SE  
will pass the
UN-evaluated EL string to the tag</font><font                          
face="Verdana">.<br>
<br>
Whether or not the tag can evaluate an UN-evaluated EL construct, or
whether or not it can accept a runtime expression depends on the tag
(and the TLD where it is defined).<br>
<br>
With </font><font face="Verdana">JSTL 1.0,                
t</font><font face="Verdana">here
are 2 categories of tag libraries:<br>
&nbsp; - EL-based<br>
&nbsp; - runtime-based<br>
<br>
Please see section 7.4 of the SE 4.2 User Guide for more details about
those 2 categories.<br>
I can add here that the EL-based TLDs defined in JSTL 1.0 can handle
UN-evaluated EL, but cannot handle runtime expressions (i.e. they
cannot handle EL that SE has already evaluated).<br>
<br>
<br>
With JSTL 1.1, there is only one set of tag libraries (no longer 2
"categories").<br>
The JSTL 1.1 tags do NOT take care of evaluating the EL... the JSP
Engine is supposed to handle EL in those cases.<br>
This means that to use JSTL 1.1 tags, and use EL as the value of
attributes of those tags, a person would have to use a Servlet 2.4
webapp, running inside a Servlet/JSP Engine that supports Servlet               
2.4.<br>
<br>
When I setup your example as you described it fails for me too, and I'd
expect that.<br>
I can make it work if I just change:<br>
<br>
&lt;%@taglib prefix="c" uri=<a                                 
class="moz-txt-link-rfc2396E"                                         
href="http://java.sun.com/jstl/core">"http://java.sun.com/jstl
/core"</a>%&gt;<br>
<br>
to be a either:<br>
<br>
&lt;%@ taglib uri=<a class="moz-txt-link-rfc2396E"             
href="http://java.sun.com/jsp/jstl/core">"http://java.sun.com/
jsp/jstl/core"</a> prefix="c" %&gt;<br>
<br>
-or-<br>
<br>
</font><font face="Verdana">&lt;%@ taglib             
uri="</font><font
face="Verdana"><a class="moz-txt-link-freetext"       
href="http://java.sun.com/jstl/core_rt">http://java.sun.com/jstl/co
re_rt</a></font><font
face="Verdana">" prefix="c" %&gt;<br>
<br>
<br>
both of which are TLDs that accept runtime expression values.<br>
<br>
Hope that helps.<br>
</font><font face="Verdana"><br>
<br>
</font>
<pre class="moz-signature" cols="72">Matt McGinty
Software Engineer
New Atlanta Communications, LLC
<a class="moz-txt-link-freetext"                                   
href="http://www.newatlanta.com">http://www.newatlanta.com</a>
; </pre>
<br>
<br>
John Fletcher wrote:
<blockquote
cite="mid08198B38967CBC478213D6FEA76C3040592159@napoleon.latitudegeo.com�
34;
type="cite">
 <pre wrap="">I have identical web applications on two separate 
servers, both running
ServletExec 5.0 with the latest (May 2006) hotfix.  Both web
applications use JSTL 1.0 tag libraries.  One is on Java 1.4.2, the
other on Java 1.5.  The web application running Java 1.5 has a Servlet
2.4 declaration in the web.xml, the other will not work unless I use a
Servlet 2.3 declaration.  The error I get when using a Servlet 2.4
declaration is:

"attribute value cannot have a request time expression value"

I get this error in the ServletExec logs when I try to run the following
jsp:

&lt;%@taglib prefix="c" uri=<a                                 
class="moz-txt-link-rfc2396E"                                         
href="http://java.sun.com/jstl/core">"http://java.sun.com/jstl
/core"</a>%&gt;
&lt;c:set var="myName" value="john"/&gt;
&lt;c:out value="${myName}"/&gt;

That convoluted introduction leads me to my two questions:

1. Is JSTL 1.0 / Servlet 2.4 a supported configuration in ServletExec?
2. How does ServletExec's processing of JSTL differ when inside a
Servlet 2.3 webapp as opposed to a Servlet 2.4 webapp?  The most
confusing thing for me is that the Servlet 2.4 / JSTL 1.0 setup works on
the other machine (in fact, there are others as well on the network with
slightly different web application configurations which also work with
the Servlet 2.4 / JSTL 1.0 setup).  I can't help but think there _must_
be some difference in the configuration of the applications, I just
can't determine what that difference might be.

Thanks for the help.

John Fletcher
Latitude Geographics Group Ltd.
<a class="moz-txt-link-abbreviated"                                
href="mailto:jfletcher@latitudegeo.com">jfletcher@latitudegeo.com&l
t;/a> <a class="moz-txt-link-abbreviated"                       
href="http://www.latitudegeo.com">www.latitudegeo.com</a>
Head Office: 204 Market Square Victoria, BC Canada V8W 3C6
Tel: (250) 381-8130 Fax: (250) 381-8132 

Geocortex Internet Mapping (<a class="moz-txt-link-abbreviated"    
href="http://www.geocortex.net">www.geocortex.net</a>) -     
Helping people succeed
with web-based geography


-------------------------------------------------------------------------
ServletExec-Interest. For archives and unsubscribe instructions, visit:

   <a class="moz-txt-link-freetext"                                
href="http://www.newatlanta.com/servletexec-i
nterest.jsp">http://www.newatlanta.com/servletexec-i
nterest.jsp</a>
 </pre>
</blockquote>
</body>
</html>

Message Thread
Date Subject Author
06/08/2006 Re: [ServletExec] JSTL 1.0 and Servlet 2.4 matt@newatlanta.com
06/08/2006 RE: [ServletExec] JSTL 1.0 and Servlet 2.4 jfletcher@latitudegeo.com
06/07/2006 [ServletExec] JSTL 1.0 and Servlet 2.4 jfletcher@latitudegeo.com
<< Back to Search Results


   
company media information terms of use privacy policy contact us