interpolated runtime values error

Posted on 2005-04-29
Last Modified: 2008-01-09
Anyone know what this JSP error message means?

Stack = com.caucho.jsp.JspParseException: /admin/grantReport/displayReport.jsp:12: interpolated runtime values are forbidden by the JSP spec at `reportByVolunteer.jsp?grantNumber=&certificateNumber=' at com.caucho.jsp.JspGenerator.error( at com.caucho.jsp.JspGenerator.hasRuntimeAttribute( at ...

The error is occurring on the following "<jsp:forward..." lines.

The objectionable code follows:

      String grantNumber = request.getParameter("grantNumber");
      String position = request.getParameter("position");

      if (position == null || position.equals("")) { %>
          <jsp:forward page="reportByVolunteer.jsp?grantNumber=<%= grantNumber %>&certificateNumber=<%= request.getParameter('certificateNumber') %>" />
<%      } else { %>
          <jsp:forward page="reportByPosition.jsp?grantNumber=<%= grantNumber %>&position=<%= position %>" />
<%      } %>

If I replace the variables with constants, the page works. I can see in the URL address bar that the variables are being passed correctly. ie ...?grantNumber=grant4&certificateNumber=&position=Webmaster&Submit=Submit
Question by:softechnics
    LVL 18

    Accepted Solution

    what happens if you do as such:

    String s = "reportByVolunteer.jsp?grantNumber=<%= grantNumber %>&certificateNumber=<%= request.getParameter('certificateNumber') %>";

         if (position == null || position.equals("")) { %>
             <jsp:forward page="<% s %>" />
    LVL 18

    Expert Comment

    oops,  <jsp:forward page="<%= s %>" />
    LVL 18

    Expert Comment

    oops again,

    String s = "reportByVolunteer.jsp?grantNumber=" + grantNumber + "&certificateNumber=" + request.getParameter('certificateNumber');

    Author Comment

    Damned! It worked!! Why?????

    I'm doing something very similar in another application and my original approach above works there!
    LVL 19

    Expert Comment

    as far as I know jsp never liked tags inside <jsp:forward..
    LVL 18

    Expert Comment

    yeah, i've noticed the same... that request.getParameter(..) in the jsp:forward tag is what made me suggest the solution i did.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Suggested Solutions

    OfficeMate Freezes on login or does not load after login credentials are input.
    For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now