Geez, after 10 hours on a Sunday I finally figured this out. It has to do
with Tomcat 5.0.28 - or rather the Servlet 2.4 spec JSP 1.2 vs 2.0. I found
this on the internet which led me to the answer:

This is about the isELIgnored page attribute.
>>If your web.xml specifies servlets 2.3 (corresponding to JSP 1.2) or
earlier, the default is true 
But it is still legal to change the default-you are permitted to use this
attribute in a JSP-2.0-compliant server regardless of the web.xml version.
If your web.xml specifies servlets 2.4 (corresponding to
JSP 2.0), the default is false

Being that I started from scratch on this project my web.xml specified the
version as 2.4 in the web-app which means you better be using the jstl 1.1
tags because those tags in the c.tld point to the RT - runtime versions of
the tags versus the EL - evaluation language versions (which expand the
expression in the tag versus in the JSP - in the JSP is the default for 2.4)


Wow! - this one sent me for a loop for quite some time. Thanks for everyones
help - you led me in the right direction.

-Jerry 



-----Original Message-----
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Bill Barker
Sent: Sunday, December 05, 2004 3:46 PM
To: [EMAIL PROTECTED]
Subject: Re: Tomcat 5.0.28 - How to stop Jasper JSP compiler from evaluting
JSTL expressions


"Jerry Rodgers" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Oh so close :> I thought you had it. Now my Tomcat JSP generated code 
> looks
> a bit more like I would expect:
>
>    _jspx_th_core_forEach_0.setItems(new String("${topnav}"));
>
> However by setting that variable now the jstl tags do not evaluate the
> expression either. The tags must key off that attribute too to know 
> whether
> to run the expression evaluator.
>
> I guess my first email must be clarified to be "how do I stop jsp from
> evaluating rtexpressions and yet still allow jstl to evaluate them within
> their tags"
>

With isELIgnored set to it's default value of "false", the following should 
evaluate to the string you want:
  <core:forEach var="menuItem" varStatus="status" items="${'${'topnav}">


> -Jerry
>
>
>
> -----Original Message-----
> From: news [mailto:[EMAIL PROTECTED] On Behalf Of Bill Barker
> Sent: Saturday, December 04, 2004 12:17 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Tomcat 5.0.28 - How to stop Jasper JSP compiler from 
> evaluting
> JSTL expressions
>
> Try:
> <[EMAIL PROTECTED] isELIgnored="true" %>
>
> "Jerry Rodgers" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> Hi,
>>
>>
>>
>> I am having a problem where the parameter this is passed to my setItems()
>> method of the jstl forEach tag is actually the .toString() version of my
>> collection. This appears to be because the servlet code generated by
>> Tomcat
>> - Jasper actually evaluates the expression and then use the coerce to
>> string
>> on my collection. I was under the impression that the generated jsp code
>> should only set the items property to the runtime expression and then the
>> tag is actually the one that evaluates the expression.
>>
>>
>>
>> Here is the problem/question. How do I make Tomcat NOT evaluate my
>> expression in the JSP because the jstl for:each tags actually have the
>> expression evaluation built into them.  Just as a test when I changed the
>> value of the parameter in the setItems() back to my expression
>> "${topnav}" -
>> then hit resume my page works correctly.  What I am currently passed by
>> Jasper is a long string that is the .toString() on all my items.
>>
>>
>>
>> // Tomcat generated this
>>
>> _jspx_th_core_forEach_0.setItems((java.lang.String)
>>
org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${topnav}",
>> java.lang.String.class, (PageContext)_jspx_page_context, null, false));
>>
>>
>>
>> // Weblogic generated this,
>>
>> _core_forEach0.setItems(weblogic.utils.StringUtils.valueOf("${topnav}"));
>> //[ /layout/nav/top/default.jsp; Line: 13]
>>
>>
>>
>> When I tried to set the <rtexpression>false</rtexpression> in the tld for
>> the items attribute then of course jasper complained and gave me this
>> exception.
>>
>> org.apache.jasper.JasperException: /layout/default.jsp(14,4) According to
>> TLD or attribute directive in tag file, attribute items does not accept
>> any
>> expressions
>>
>>
>>
>> I need jasper to allow the expression but not execute it. How do I do
>> this?
>>
>>
>>
>>>> Other details. - my jsp page
>>
>> <tiles:importAttribute />
>>
>> <core:forEach var="menuItem" varStatus="status" items="${topnav}">
>>
>>             <html:message name="menuItem" property="value"/>
>>
>> </core:forEach>
>>
>>
>>
>> I have tested this with both version 1.0.6 and 1.1. of the jstl tags. 
>> Same
>> behavior in both. It doesn't appear to be the tags fault but rather
>> Jasper.
>>
>>
>>
>> Thanks everyone,
>>
>> Jerry
>>
>>
>>
>>
>>
>>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED] 




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to