interpolated runtime values error

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(JspGenerator.java:1577) at com.caucho.jsp.JspGenerator.hasRuntimeAttribute(JspGenerator.java:1397) at ...

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

The objectionable code follows:

<body>
<%
      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 %>" />
<%      } %>
</body>

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
softechnicsAsked:
Who is Participating?
 
bobbit31Commented:
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 %>" />
0
 
bobbit31Commented:
oops,  <jsp:forward page="<%= s %>" />
0
 
bobbit31Commented:
oops again,

String s = "reportByVolunteer.jsp?grantNumber=" + grantNumber + "&certificateNumber=" + request.getParameter('certificateNumber');
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
softechnicsAuthor Commented:
Damned! It worked!! Why?????

I'm doing something very similar in another application and my original approach above works there!
0
 
KuldeepchaturvediCommented:
as far as I know jsp never liked tags inside <jsp:forward..
0
 
bobbit31Commented:
yeah, i've noticed the same... that request.getParameter(..) in the jsp:forward tag is what made me suggest the solution i did.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.