Results 1 to 3 of 3
- 03-13-2012, 02:47 AM #1
Member
- Join Date
- Mar 2012
- Posts
- 2
- Rep Power
- 0
Very similar problem to Iterating over a map of objects
I have the very similar problem to above, so I'm eager to be replied at this by some who knows answer...
I have searched for this, but I found the 'eachFor' returns Map.Entry as its attribute 'var'.
But when I code like above, ( f.e ${entry.key} ) The Exception named PropertyNotFoundException, and the var (entry) class was to be found treated as java.lang.String class by its jstl tag library (imported jstl jar framework). I'm using Jstl version, 1.2.
Very embarrassing to me. Please somebody help me (us with javaax)!!Last edited by Czen, Yeong-yil; 03-13-2012 at 02:52 AM.
- 03-13-2012, 04:29 AM #2
Re: Very similar problem to Iterating over a map of objects
Split from Iterating over a map of objects
Don't waken old dead threads. when you have a question, start your own -- they're free.
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 03-13-2012, 05:08 AM #3
Member
- Join Date
- Mar 2012
- Posts
- 2
- Rep Power
- 0
Re: Very similar problem to Iterating over a map of objects
Thanx db, I'll remind the date of posting to myself when I add post to another.
// for another like-me
Anyway, I fixed it myself.
But I don't certify the pin-point reason of the Exception.
I just can guess it might be version problem. (of jstl - tld, version defining.. etc ).
It works after I downloaded 1.1.2 version of jstl and replaced the tld files like c.tld.. ( and it has different definition of version , and so forth - I can't (Acturally,. don't want to ? ;-() catch whole differences)
-------------------------------------------
For the first of this post was dead. I'm adding some brief thing of this post.
I was using some jstl's core such as below code
<c:forEach var="entry" items="${mapReferenceNameContainedInServletContext LikeSession}">
${entry.key} : ${entry.value}
</c:forEach>
I expected the result 'keyValue : theValue' code printed but,
the Exception named PropertyNotFoundException, because - I guess - the JSTL tag returns the var object as java.lang.String...
And now It worked after changing, adding, replacing to Jstl 1.1.2.
For referencing more..
the Exception issued c.tld file's initial script be posted below.
---------------------------------------------------------------
<?xml version="1.0" encoding="EUC-KR" ?>
<!DOCTYPE taglib
PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
"http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
<taglib>
<tlib-version>1.0</tlib-version>
<jsp-version>1.2</jsp-version>
<short-name>c</short-name>
<uri>http://java.sun.com/jstl/core</uri>
<display-name>JSTL core</display-name>
<description>JSTL 1.0 core library</description>
..................
---------------------------------------------------------------------
And now the replaced c.tld
---------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8" ?>
<taglib xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
version="2.0">
<description>JSTL 1.1 core library</description>
<display-name>JSTL core</display-name>
<tlib-version>1.1</tlib-version>
<short-name>c</short-name>
<uri>http://java.sun.com/jsp/jstl/core</uri>
...................................Last edited by Czen, Yeong-yil; 03-13-2012 at 05:21 AM.
Similar Threads
-
How to update state variables in Objects (similar to pass by reference)
By JimmyD in forum Advanced JavaReplies: 9Last Post: 10-21-2011, 09:07 PM -
How to save large amounts of similar objects?
By nieuwenhuizen-jk in forum New To JavaReplies: 12Last Post: 05-13-2011, 03:21 PM -
Iterating over an array of objects in jstl
By rahullahiri007 in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 07-21-2010, 07:25 AM -
Iterating over a map of objects
By javaaz in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 07-08-2010, 10:29 PM -
iterating through a collection of objects
By Scotty Boy in forum New To JavaReplies: 0Last Post: 04-10-2008, 01:28 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks