Women in Technology

Hear us Roar



Article:
  JSP 2.0: The New Deal, Part 1
Subject:   Dynamically Build Expressions to Evaluate?
Date:   2004-08-24 10:14:16
From:   amitcbhayani
Response to: Dynamically Build Expressions to Evaluate?

Hi Seth,


I am trying to acchieve what u have said. But I get following error



/pages/event/causalComponents.jsp(52,12) "${componentRows.${columns}" contains invalid expression(s): javax.servlet.jsp.el.ELException: Encountered "{", expected one of ["}", ".", ">", "gt", "<", "lt", "==", "eq", "<=", "le", ">=", "ge", "!=", "ne", "[", "+", "-", "*", "/", "div", "%", "mod", "and", "&&", "or", "||", "?"]' org.apache.jasper.JasperException: /pages/event/causalComponents.jsp(52,12) "${componentRows.${columns}" contains invalid expression(s): javax.servlet.jsp.el.ELException: Encountered "{", expected one of ["}", ".", ">", "gt", "<", "lt", "==", "eq", "<=", "le", ">=", "ge", "!=", "ne", "[", "+", "-", "*", "/", "div", "%", "mod", "and", "&&", "or", "||", "?"] at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39) at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407) at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:200) at org.apache.jasper.compiler.JspUtil.validateExpressions(JspUtil.java:596) at


Any input would be of great help.


Thanks
Amit

Full Threads Oldest First

Showing messages 1 through 1 of 1.

  • Dynamically Build Expressions to Evaluate?
    2005-06-01 05:22:19  JavaJockey [View]

    Dear All,

    Can anyone answer this for me. I have a similiar problem. I am trying to access form bean properties, e.g. title1, title2 etc by dynamically linking the indexId 'ctr' to the title part. This is having no effect. For instance "report.title1" should return "company" on the screen, instead all I get is "report.title." I have enclosed my code fragment to illustrate. I have based it on various sources including the stuff in this thread, but without sucess. Please help if you can.

    Regards...

    <table width="85%" border="0">
    <tbody>
    <c:set var="style" value="datalightsmall" scope="page" />
    <tr>
    <logic:iterate id="record" property="report" name="reportSearchForm" indexId="ctr" scope ="request">

    <!--c:set var="style" value="datalightsmall" scope="page" /-->
    <c:choose>
    <c:when test= "${(ctr =='1')}">
    <c:set var="value" value="${record.title${[ctr]}}"/>
    <td class="viewcolumntitle" width="20%"> <c:out value="${value}" /></td></c:when>
    <c:otherwise>
    <!-- Do nothing -->
    </c:otherwise></c:choose>
    </logic:iterate>
    </tr>
    </tbody>
    </table>