-
Hashtable to jsp
Hi there. The problem I'm having is in passing a hashtable to my jsp and reading it's information using core tags. My hashtable contains a series of beans each representing a record. The hashtable itself is contained within another bean, and it is within this that it is passed to the jsp. Urrgh hope this is making sense.
In my jsp the following code works fine:
<jsp:useBean id="accbean" class="<container bean>" scope="request"/>
<c:set var = "myList" value = "${accbean.accList}" />
<c:forEach var="Record" items="${myList}">
<c:out value="${Record.key}"/>
</c:forEach>
However when I try and read further properties of the record (one property is called "status") like so;
<c:forEach var="Record" items="${myList}">
<c:out value="${Record.key}"/>
<c:out value="${Record.status}"/>
</c:forEach>
I get the following error:
An error occurred while evaluating custom action attribute "value" with value "${Record.status}": Unable to find a value for "status" in object of class "java.util.Hashtable$Entry" using operator "." (null)
This worked just fine when I was using an ArrayList instead of a hashtable? What am I doing wrong?
Sorry about the large post! Hope it all makes sense!
-
Further hashtable stuff
Tricky one eh?
What are people's general impressions of this? Has anyone passed a hashtable to a jsp in this manner in the past? Or could it be that it isn't possible to pass information in this way? Any discussion would be welcome!
-
Hashtable display in JSP
Hi everyone, I know this thread is quite old but if it can be useful to anyone ... just use ${Record.value} instead of ${Record.status}. This has worked fine for me!
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks