Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #13102

Re: JSTL: getting a map's keys

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Chris Riesbeck <Chris.Riesbeck@gmail.com>
Newsgroups comp.lang.java.programmer
Subject Re: JSTL: getting a map's keys
Date Wed, 21 Mar 2012 13:09:05 -0500
Lines 32
Message-ID <9sujq2Foc1U1@mid.individual.net> (permalink)
References <9spbepF1baU1@mid.individual.net> <xLP9r.4373$dq4.2106@newsfe23.iad> <9srshfFjo5U1@mid.individual.net> <9sruffF39oU1@mid.individual.net> <14359232.4616.1332266714833.JavaMail.geo-discussion-forums@pbcr5>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Trace individual.net p02bgTAanjrbbXskTcX7DALV/RNr36WjNbK1mc2n1I1Ircf5c3
Cancel-Lock sha1:WT+bpv5M/YQ1bQop43pABD6RhdU=
User-Agent Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko/20120312 Thunderbird/11.0
In-Reply-To <14359232.4616.1332266714833.JavaMail.geo-discussion-forums@pbcr5>
Xref csiph.com comp.lang.java.programmer:13102

Show key headers only | View raw


On 3/20/2012 1:05 PM, Lew wrote:
> Chris Riesbeck wrote:

>> http://docs.oracle.com/javaee/5/api/javax/servlet/jsp/JspApplicationContext.html
>>
>> So the Map interpretation will always override the Bean interpretation.
>
> Now that your main question is answered, a couple of comments are in order.
>
> - Don't have scriptlet in your JSPs.

I never do. That was in the original JSP just to show that getKeys() was 
functioning and returning a non-empty result

> - If you had *composed* a 'Map' into a custom class rather than
> inheriting 'Map', you would not have had the problem. Your custom
> class would have been resolved by the bean resolver. - This in turn
> would make for a better design overall. Instead of your view artifact
> (the JSP) caring about the implementation details of the map and its
> set of keys, you'd have a controller call like 'getKeys()' or
> whatever that would cleanly separate the logic of how you get them
> from presentation concerns.

Using delegation (my preference also) doesn't support the JSP EL form 
${rates["Bill"]}. If I had a custom class, I'd need a custom tag or 
custom EL resolver to make that work.

The original goal was to get the JSTL away from knowing about Map's, in 
particular about entry.key and entry.value.


Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

JSTL: getting a map's keys Chris Riesbeck <Chris.Riesbeck@gmail.com> - 2012-03-19 13:15 -0500
  Re: JSTL: getting a map's keys Lew <lewbloch@gmail.com> - 2012-03-19 12:57 -0700
  Re: JSTL: getting a map's keys Tim Slattery <Slattery_T@bls.gov> - 2012-03-19 16:08 -0400
    Re: JSTL: getting a map's keys Chris Riesbeck <Chris.Riesbeck@gmail.com> - 2012-03-19 16:06 -0500
      Re: JSTL: getting a map's keys Chris Riesbeck <Chris.Riesbeck@gmail.com> - 2012-03-19 16:39 -0500
    Re: JSTL: getting a map's keys markspace <-@.> - 2012-03-19 15:27 -0700
  Re: JSTL: getting a map's keys Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-03-19 16:59 -0700
    Re: JSTL: getting a map's keys Chris Riesbeck <Chris.Riesbeck@gmail.com> - 2012-03-20 12:19 -0500
      Re: JSTL: getting a map's keys Chris Riesbeck <Chris.Riesbeck@gmail.com> - 2012-03-20 12:52 -0500
        Re: JSTL: getting a map's keys Lew <lewbloch@gmail.com> - 2012-03-20 11:05 -0700
          Re: JSTL: getting a map's keys Chris Riesbeck <Chris.Riesbeck@gmail.com> - 2012-03-21 13:09 -0500
            Re: JSTL: getting a map's keys Lew <noone@lewscanon.com> - 2012-03-22 07:51 -0700
              Re: JSTL: getting a map's keys Chris Riesbeck <Chris.Riesbeck@gmail.com> - 2012-03-22 12:53 -0500
                Re: JSTL: getting a map's keys Lew <lewbloch@gmail.com> - 2012-03-22 13:23 -0700
                Re: JSTL: getting a map's keys Chris Riesbeck <Chris.Riesbeck@gmail.com> - 2012-03-23 12:23 -0500
                Re: JSTL: getting a map's keys Lew <noone@lewscanon.com> - 2012-03-23 13:50 -0700
                Re: JSTL: getting a map's keys Chris Riesbeck <Chris.Riesbeck@gmail.com> - 2012-03-26 14:10 -0500
        Re: JSTL: getting a map's keys Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-03-20 11:28 -0700
        Re: JSTL: getting a map's keys markspace <-@.> - 2012-03-20 11:29 -0700
          Re: JSTL: getting a map's keys Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-03-20 12:10 -0700

csiph-web