Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2012
    Posts
    2
    Rep Power
    0

    Default 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.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is online now Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,199
    Rep Power
    19

    Default 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.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    Join Date
    Mar 2012
    Posts
    2
    Rep Power
    0

    Default 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

  1. Replies: 9
    Last Post: 10-21-2011, 09:07 PM
  2. How to save large amounts of similar objects?
    By nieuwenhuizen-jk in forum New To Java
    Replies: 12
    Last Post: 05-13-2011, 03:21 PM
  3. Iterating over an array of objects in jstl
    By rahullahiri007 in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 07-21-2010, 07:25 AM
  4. Iterating over a map of objects
    By javaaz in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 07-08-2010, 10:29 PM
  5. iterating through a collection of objects
    By Scotty Boy in forum New To Java
    Replies: 0
    Last Post: 04-10-2008, 01:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •