"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]