Forums Register Login
custom tag attribute items cannot be runtime expression
I am getting following error message, for the "For Each" statement:

custom tag attribute items cannot be runtime expression (value : ${user.getMessages})

(since html tags are not allowable I have replaced them w/< and >, Hopefully you can get an idea of the code)

<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="IBM Software Development Platform">
<META http-equiv="Content-Style-Type" content="text/css">
<LINK href="theme/Master.css" rel="stylesheet" type="text/css">
<P><jsp:useBean id="user" type="com.ibm.tutorials.rational.User" scope="session">
<jsp:getProperty name="user" property="name" /> <BR>
Your message as follows

<TABLE border="1">
<TD width="112" bgcolor="silver">From</TD>
<TD width="421" bgcolor="silver">Text</TD>
<c:forEach var="aMessage" items="${user.messages}">
<TD width="112"><c ut value="${aMessage.senderName}"></c ut></TD>
<TD width="421"><c ut value="${aMessage.text}"></c ut></TD>

Here's my "User.java" class FYI

package com.ibm.tutorials.rational;
import java.util.Vector;

public class User {
private String name;
private Vector messages;

// Simple implementation of a set of users -
// only for illustration purposes. Normally users
// would have to be maintained and managed in a database
private static User[] hardCodedUsers = {
new User("Joe"),
new User("Jane"),
new User("Tony"),
new User("Tina") };

public static User[] getHardCodedUsers() {
return User.hardCodedUsers;

public User(String name) {
this.name = name;
messages = new Vector();

public String getName() {
return this.name;

public Vector getMessages() {
return messages;

public void addMessage(Message message) {

// Return a User object based on user name or a null if a user
// by that name does not exist

public static User getUser(String username) {
User[] allUsers = User.getHardCodedUsers();
for (int i = 0 ; i < allUsers.length ; i++)
if (allUsers[i].getName().compareTo(username) == 0)
return hardCodedUsers[i];
return null;

[ April 29, 2005: Message edited by: Bear Bibeault ]
In your tld, did you mark rtexprvalue to "true"?

What version of JSP and JSTL are you using? From your JSTL URI I am aasuming JSP 1.x and JSTL 1.0?
jsp version is 1.1

I do not see <rtexprvalue> in my web.xml ?

Should it be any where else?
rtexprvalue> is in .tld file. But I cannot find the tld file in my workspace.

I am on Rational software architect 6.0.
The tld in question is probably embedded in your JSTL implementation. You may want to try the 'rt' version of the URI. If I recall correctly, this syntax is:

but you should look it up in the docs (or the embedded tld) that came with your JSTL implementation to be sure.
Should have read your code.
I saw "custom tag" in your subject and assumed you were writing custom tags.
I didn't notice the JSTL tags in your code.

Disregard my previous post.
I suggest huckleberry pie. But the only thing on the gluten free menu is this tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database

This thread has been viewed 5796 times.

All times above are in ranch (not your local) time.
The current ranch time is
Feb 19, 2019 20:02:40.