running IBM tutorial on my machine
posted 20 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
I am following instructions given in the following website and built the message center. (I downloaded RSA 6.0 trial and working on it)
https://www6.software.ibm.com/dw/education/r/rdynwebsites/
In my JSP page where I am retrieving the messages I have a fo loop and I am getting error below for the JSP TAG with FOR loop
<c:forEach var="aMessage" items="${user.messages}">
Error was
JSP Translate: Custom tag attribute items cannot be runtime expression
Value : [${user.messages}]
Can someone shed some light please?
Thanks
Mei
https://www6.software.ibm.com/dw/education/r/rdynwebsites/
In my JSP page where I am retrieving the messages I have a fo loop and I am getting error below for the JSP TAG with FOR loop
<c:forEach var="aMessage" items="${user.messages}">
Error was
JSP Translate: Custom tag attribute items cannot be runtime expression
Value : [${user.messages}]
Can someone shed some light please?
Thanks
Mei
posted 20 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Mei,
That site is password protected. Can you post a code snippet of the surrounding code?
I suspect that you are trying to use expression language within a tag attribute, which is not allowed. But I don't see how that would find its way into a tutorial.
That site is password protected. Can you post a code snippet of the surrounding code?
I suspect that you are trying to use expression language within a tag attribute, which is not allowed. But I don't see how that would find its way into a tutorial.
[OCP 21 book] | [OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Me Fdo
Ranch Hand
Posts: 33
posted 20 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Hi
Here's the code snippet, I have bolded the line I am getting the error "Custome tag attribute cannot be an expression"
(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"%>
<HTML>
<HEAD>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="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">
<TITLE>messageCenter.jsp</TITLE><br /> </HEAD><br /> <BODY><br /> <P><jsp:useBean id="user" type="com.ibm.tutorials.rational.User" scope="session"><br /> </jsp:useBean><br /> <BR><br /> Welcome<br /> <jsp:getProperty name="user" property="name" /> <BR><br /> <BR><br /> Your message as follows<br /> <BR><br /> </P><br /> <br /> <TABLE border="1"><br /> <TBODY><br /> <TR><br /> <TD width="112" bgcolor="silver">From</TD><br /> <TD width="421" bgcolor="silver">Text</TD><br /> </TR><br /> <c:forEach var="aMessage" items="${user.messages}"><br /> <TR><br /> <TD width="112"><c
ut value="${aMessage.senderName}"></c
ut></TD>
<TD width="421"><c
ut value="${aMessage.text}"></c
ut></TD>
</TR>
</c:forEach>
</TBODY>
[ April 18, 2005: Message edited by: Me Fdo ]
[ April 18, 2005: Message edited by: Me Fdo ]
Here's the code snippet, I have bolded the line I am getting the error "Custome tag attribute cannot be an expression"
(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"%>
<HTML>
<HEAD>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="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">
<TITLE>messageCenter.jsp</TITLE><br /> </HEAD><br /> <BODY><br /> <P><jsp:useBean id="user" type="com.ibm.tutorials.rational.User" scope="session"><br /> </jsp:useBean><br /> <BR><br /> Welcome<br /> <jsp:getProperty name="user" property="name" /> <BR><br /> <BR><br /> Your message as follows<br /> <BR><br /> </P><br /> <br /> <TABLE border="1"><br /> <TBODY><br /> <TR><br /> <TD width="112" bgcolor="silver">From</TD><br /> <TD width="421" bgcolor="silver">Text</TD><br /> </TR><br /> <c:forEach var="aMessage" items="${user.messages}"><br /> <TR><br /> <TD width="112"><c
ut value="${aMessage.senderName}"></c
ut></TD><TD width="421"><c
ut value="${aMessage.text}"></c
ut></TD></TR>
</c:forEach>
</TBODY>
[ April 18, 2005: Message edited by: Me Fdo ]
[ April 18, 2005: Message edited by: Me Fdo ]
Me Fdo
Ranch Hand
Posts: 33
posted 20 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Here's the user.java class which has the message attribute defined as private , instead of user.message I used user.getMessage in the FOR EACH loop in the jsp page still I am getting the same error.
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) {
messages.addElement(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;
}
} :roll:
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) {
messages.addElement(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;
}
} :roll:
| Let's get him boys! We'll make him read this tiny ad! The new gardening playing cards kickstarter is now live! https://www.kickstarter.com/projects/paulwheaton/garden-cards |











