JSF 1.2 HashMap - what am I missing?

I am having an issue and need a second pair of eyes - I am doing something wrong?
Many thanks in advance for any time or assistance!
I have a bean with a HashMap which uses an Integer key. My page attempts to get a property from an object in the bean's hashmap. My page shows nothing - no errors, but also no data. It acts as if the .get() gets called, but returns null. I have tried everything I can think of in debug mode, and I have verified the hashmap is returned with item 1 included & intact, but I still see nothing. I also monitor the server console, and see no errors. I am using Sun RI JSF 1.2 & glassfish.
I have created a sample project to demonstrate.
*beans.jsp [snippet]:*
bq. <f:view> \\ <h:outputText id="testText" value="{color:#ff0000}#{bean.nonBeans[1].text}{color}" /> \\ </f:view>
*faces-config.xml [snippet]:*
<managed-bean>
bq. <managed-bean-name>bean</managed-bean-name> \\ <managed-bean-class>com.milsoft.bugReport.Bean</managed-bean-class> \\ <managed-bean-scope>session</managed-bean-scope>
</managed-bean>
*2 classes:*
package com.milsoft.bugReport;
import java.util.HashMap;
public class Bean {
bq. {color:#ff0000} \\ private HashMap<Integer, NonBean> nonBeans = null;{color} \\ public Bean() { \\ super(); \\ nonBeans = new HashMap<Integer, NonBean>(); \\ {color:#ff0000} nonBeans.put(Integer.valueOf(1), new NonBean("One"));{color} \\ nonBeans.put(Integer.valueOf(2), new NonBean("Two")); \\ nonBeans.put(Integer.valueOf(3), new NonBean("Three")); \\ } \\ {color:#ff0000} \\ public HashMap<Integer, NonBean> getNonBeans() { \\ return nonBeans; \\ }{color} \\ public void setNonBeans(HashMap<Integer, NonBean> nonBeans) { \\ this.nonBeans = nonBeans; \\ }
bq.
package com.milsoft.bugReport;
public class NonBean {
bq. private String text; \\ public NonBean(String text) { \\ this.text = text; \\ } \\ {color:#ff0000} \\ public String getText() { \\ return text; \\ }{color} \\ public void setText(String text) { \\ this.text = text; \\ }

If you change the nonBeans property of Bean to something like this:
nonBeans = new HashMap<Long, NonBean>();
it does work!
The Expression Language Specification Version 2.1 makes you understand that integer literals are treated as Long objects.
The following specification's sections mention Long as the type for integer literals:
*1.7 Arithmetic Operators*
Arithmetic is provided to act on integer (BigInteger and Long) and floating point
*(BigDecimal and Double)...*
*1.9 Collected Syntax*
The value of an IntegerLiteral ranges from Long.MIN_VALUE to
Long.MAX_VALUE...
furthermore, many sections about operators mention the coercing to Long
That way you cannot use Integer as key, as Integer objects are only comparable to other Integer objects.
Your value into nonBeans[1] is being turned into something like nonBeans.get(new Long(1))

Similar Messages

  • Not getting PPR, what am I missing?

    Using JDeveloper 11.1.1.4.0
    I have a region on my page and inside that region I have an inputDate field and a treetable. On the inputDate I made a custom value change listener (code below) that I expected to refresh the region and show updated values in the treetable. I first tried defining this bean on my bounded task flow as "request" and then as "session". Both ways it appears to work (I get messages on the weblogic console) but the same data remains in the treetable. What am I missing?
        public String changedAsOfDate(ValueChangeEvent vce) {
            String newValue = (String)vce.getNewValue();
            // System.out.println("newValue is " + newValue);
            vce.getComponent().processUpdates(FacesContext.getCurrentInstance());
            UIComponent uic = null;
            uic = vce.getComponent().getParent().getParent();
            // Get access to the adf faces context for view scope
            AdfFacesContext adfctx = null;
            adfctx = AdfFacesContext.getCurrentInstance();
            Map pageParams = adfctx.getPageFlowScope();
            ViewAmtsParameters beanParams =
                (ViewAmtsParameters)pageParams.get("ViewAmtsParameters");
            beanParams.setAsOfDateParam(newValue);
            BindingContainer bindings = getBindings();
            OperationBinding operationBinding =
                bindings.getOperationBinding("ExecuteWithParams");
            // Set the parameters for the query
            operationBinding.getParamsMap().put("cid", beanParams.clientIdParam);
            operationBinding.getParamsMap().put("can", beanParams.canParam);
            operationBinding.getParamsMap().put("asofdate", newValue);
            System.out.printf("first execute parms  %s   %s      %s \n",
                              operationBinding.getParamsMap().get("cid"),
                              operationBinding.getParamsMap().get("can"),
                              operationBinding.getParamsMap().get("asofdate"));
            operationBinding.execute();
            if (!operationBinding.getErrors().isEmpty()) {
                return null;
            // I requery the associated levels with "ExecuteWithParams#" as in the
            // above code, then
            System.out.println("Before PPR");
            System.out.println(uic.getId());
            adfctx.addPartialTarget(uic);
            System.out.println("After PPR");
            return null;
        }BTW, I get the correct region ID on the System.out.println(uic.getId()); it matches what I see on Firebug.
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
      <jsp:directive.page contentType="text/html;charset=UTF-8"/>
      <f:view>
        <af:document id="d1" maximized="true">
          <af:form id="f1">
            <af:panelStretchLayout topHeight="50px" id="psl1">
              <f:facet name="top">
                <af:panelGroupLayout id="pgl1">
                  <af:panelFormLayout id="pfl0">
                    <af:inputText label="Client ID" id="it1"
                                  value="#{pageFlowScope.CID}"/>
                    <af:inputText label="Account" id="it2"
                                  value="#{pageFlowScope.Can}"/>
                  </af:panelFormLayout>
                </af:panelGroupLayout>
              </f:facet>
              <f:facet name="center">
                        <af:region value="#{bindings.TAX_ViewAmtsOwedTreeTbl_BTF1.regionModel}"
                                   id="r1" inlineStyle="AFStretchWidth"/>
              </f:facet>
            </af:panelStretchLayout>
          </af:form>
        </af:document>
      </f:view>
    </jsp:root>Thanks,
    Troy

    Here is my jsff:
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
      <af:panelGroupLayout id="amtsowedpgl1">
          <af:inputDate label="As Of Date" id="amtsowedid1"
                        value="#{pageFlowScope.ViewAmtsParameters.asOfDateParam}"
                        autoSubmit="true"
                        valueChangeListener="#{RecalcAmtsOwed.changedAsOfDate}">
            <af:convertDateTime pattern="MMM dd, yyyy" secondaryPattern="MM/dd/yyyy"
                                id="cvtdate"/>
          </af:inputDate>
        <af:panelCollection id="amtsowedpc1" inlineStyle="border-style:none; width:900px;"
                            featuresOff="wrap freeze">
          <f:facet name="toolbar">
            <af:toolbar id="toolbar1">
              <af:commandToolbarButton text="Export All Rows to Excel" id="amtsowedctb1"
                                       immediate="true"
                                       shortDesc="Exports all rows that are exposed.">
                <af:exportCollectionActionListener exportedId="amtsowedtt1" type="excelHTML"
                                                   title="Amounts Due for #{pageFlowScope.ViewAmtsParameters.canParam}"
                                                   filename="AmtsDue#{sessionScope.Can}.xls"/>
              </af:commandToolbarButton>
              <af:commandToolbarButton text="Export Selected Rows to Excel"
                                       immediate="true" id="exportSelected"
                                       shortDesc="Exports selected rows that are exposed.">
                <af:exportCollectionActionListener type="excelHTML" exportedId="amtsowedtt1"
                                                   filename="SelAmtsDue#{pageFlowScope.ViewAmtsParameters.canParam}.xls"
                                                   title="Selected Rows of Amounts Due for #{sessionScope.Can}"
                                                   exportedRows="selected"/>
              </af:commandToolbarButton>
              <af:commandToolbarButton text="Print Amounts Due" id="amtsowedctb2"
                                       shortDesc="Opens printable screen of this table.">
                <af:showPrintablePageBehavior/>
              </af:commandToolbarButton>
            </af:toolbar>
          </f:facet>
          <af:treeTable value="#{bindings.GetAmtsGrandTotal_VO2.treeModel}"
                        var="node"
                        selectionListener="#{bindings.GetAmtsGrandTotal_VO2.treeModel.makeCurrent}"
                        rowSelection="multiple" id="amtsowedtt1" width="900"
                        columnSelection="multiple" inlineStyle="border-style:none;"
                        summary="This table dynamically displays the amounts due, (interest, penalties and attorney fees--if any) and a total due.  The rows can be expanded to show the above amounts by year, tax unit and owner."
                        shortDesc="Amounts Due" autoHeightRows="0"
                        immediate="false" partialTriggers=":::amtsowedid1"
                        clientComponent="true"
                        binding="#{RecalcAmtsOwed.amtsowedtt1}">
            <f:facet name="nodeStamp">
              <af:column id="amtsowedc1" width="130"
                         inlineStyle="#{node.bindings.NodeType=='aggregate'?'font-weight:bold;':''}">
                <af:outputText value="#{node.bindings.NodeLabel}" id="amtsowedot1"/>
              </af:column>
            </f:facet>
            <af:column width="45" id="amtsowedc2" headerText="Tax Year"
                       visible="true" inlineStyle="text-align:center;"
                       sortable="true" sortProperty="#{node.bindings.Taxyear}">
              <af:outputText value="#{node.bindings.Taxyear}" id="amtsowedot2"/>
            </af:column>
            <af:column width="40" id="amtsowedc3" visible="true" headerText="Tax Unit"
                       inlineStyle="text-align:center;"
                       sortable="true" sortProperty="#{node.bindings.Taxunit}"
                       filterable="true" filterFeatures="caseInsensitive">
              <af:outputText value="#{node.bindings.Taxunit}" id="amtsowedot3"/>
            </af:column>
            <af:column id="amtsowedc4" align="right" headerText="Calculated Levy"
                       inlineStyle="#{node.bindings.NodeType=='aggregate'?'font-weight:bold;':''};"
                       visible="false">
              <af:outputText value="#{node.bindings.Calclevy}" id="amtsowedot4"/>
            </af:column>
            <af:column id="amtsowedc5" align="right" headerText="Levy Due"
                       inlineStyle="#{node.bindings.NodeType=='aggregate'?'font-weight:bold;':''};"
                       visible="false">
              <af:outputText value="#{node.bindings.Ballevydue}" id="amtsowedot5"/>
            </af:column>
            <af:column id="amtsowedc6" align="right" headerText="Interest Due"
                       inlineStyle="#{node.bindings.NodeType=='aggregate'?'font-weight:bold;':''};"
                       visible="false">
              <af:outputText value="#{node.bindings.Intdue}" id="amtsowedot6"/>
            </af:column>
            <af:column id="amtsowedc7" align="right" headerText="Penalty Due"
                       inlineStyle="#{node.NodeType=='aggregate'?'font-weight:bold;':''};"
                       visible="false">
              <af:outputText value="#{node.bindings.Pendue}" id="amtsowedot7"/>
            </af:column>
            <af:column id="amtsowedc8" align="right" headerText="Attorney Due"
                       inlineStyle="#{node.bindings.NodeType=='aggregate'?'font-weight:bold;':''};"
                       visible="false">
              <af:outputText value="#{node.bindings.Attydue}" id="amtsowedot8"/>
            </af:column>
            <af:column id="amtsowedc9" align="right" headerText="Total Due"
                       inlineStyle="#{node.bindings.NodeType=='aggregate'?'font-weight:bold;':''};"
                       visible="true">
              <af:outputText value="#{node.bindings.Totalbaldue}" id="amtsowedot9"/>
            </af:column>
            <f:facet name="pathStamp">
              <af:outputText value="#{node}" id="amtsowedot0"/>
            </f:facet>
          </af:treeTable>
        </af:panelCollection>
      </af:panelGroupLayout>
    </jsp:root>Troy
    Edited by: Hoopestr on Nov 16, 2011 3:27 PM Bumped up
    Edited by: Hoopestr on Nov 17, 2011 8:00 AM--Please look. Can't I refresh a region, must it be the table? I tried to refresh the table only and it didn't work, so I went to refreshing the region--which also doesn't work.

  • I want to use wifi for Apple TV, but it doesn't prompt for a password, so never connects.  What am I missing?  Can I only use it via a non-password-protected wifi connection?

    I want to use wifi for Apple TV, but it doesn't prompt for a password, so never connects.  What am I missing?  Can I only use it via a non-password-protected wifi connection?

    Hi - you might want to post this question on the Apple TV area - you would probably get a quicker response - if you have a specific question relating to Apple routers then post back here

  • IPhone 5s doesn't ring and goes directly to voice mail. Do not disturb is disabled. Have reset network settings and did a hard reset.  What am I missing?

    iPhone 5s doesn't ring and goes directly to voice mail. Do not disturb is disabled. Have reset network settings and did a hard reset.  What am I missing?

    Call your phone carrier - that's a problem for them to resolve.

  • I would like to be able to edit MP4s in CS5.  I can not open the file. What am I missing?

    I would like to be able to edit MP4s in CS5.  I can not open the file. What am I missing?

    According to the publisher For GoSystem Tax, the 32-bit version of Internet Explorer 8, 9, or 10 is required.  Which means it can't be accessed from an iPad.  This seems weird.  I would recommend you contact the publisher.

  • HT1209 My Itunes Library and iPhone have fallen out of sync on music over the yearsare - how can I compare my itunes library with my Iphone  to see what songs are missing from my library so I can then bring my Library up to date

    My Itunes Library and iPhone have fallen out of sync on music over the yearsare - how can I compare my itunes library with my Iphone  to see what songs are missing from my library so I can then bring my Library up to date

    Hello Solid Buck,
    Thank you so much for providing the details about the duplicate song issue you are experiencing.  It sounds like you would like to remove the duplicate songs that will not play on your iPhone, but when you connect it to iTunes, iTunes only shows you one copy of the song on your iPhone. 
    In this situation, I recommend deleting the individual songs that do not play directly from your iPhone.  I found the steps to do this on page 61 of the iPhone User Guide (http://manuals.info.apple.com/en_US/iphone_user_guide.pdf):
    Delete a song from iPhone: In Songs, swipe the song, then tap Delete.
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • No Mirroring in Ipad 2? I have IPAD2 and Apple Tv 4.3. I can airplay videos/music from Ipad2 to my HDTV via ATV, but I cant mirror it. When I select airplay to switch from Ipad2 to Apple TV, Mirroring does not show as an option. What am I missing?

    No Mirroring in Ipad 2?
    I have IPAD2 and Apple Tv 4.3. I can airplay videos/music from Ipad2 to my HDTV via ATV, but I cant mirror it. When I select airplay to switch from Ipad2 to Apple TV, Mirroring does not show as an option. What am I missing?

    That feature is not yet available, it is coming with IOS 5
    http://www.apple.com/ca/ios/ios5/features.html

  • In iTunes 10, I could type "Sinatra" in the search file, and would get a list of all tracks with "Sinatra" in any field.   In iTunes 11 I get these clever little windows, with nice arrows, but no lists to view.   What am I missing?

    In iTunes 10, I could type "Sinatra" in the search file, and would get a list of all tracks with "Sinatra" in any field.   In iTunes 11 I get these clever little windows, with nice arrows, but no lists to view.   What am I missing?

    Thanks for chipping in.   I discovered something after trying what you suggested.   I have quite a few collections of hits by year from Time Life and Billboard.  I've eliminated duplicate tracks that appear in both collections (or other CDs for that matter), but cross-reference the CD where I deleted the track and placed in in the comments section of the CD track I retained.   If I "search" by song name, only the remaining track appears.   But if I want to hear for example Classic Rock 1964, only those tracks remaining would be there when I pull up that CD.   So, I type "Classic Rock 1964,"  in the search field.  First the boxes on the right of the screen open up showing album icons.  Showing four tracks by album with a button to view 10 more, then four songs with an option to vies 18 more.   I finally noticed that at the top of the boxes is a blue band that reads, :Show Classic Rock 1964 in Music.  When I double click on this blue band, all 24 tracks from the original CD appear in the song list format even though I had deleted two of them because they appeard in a Beach Boys CD.   On those tracks, I had referenced Classic Rock 1964 in the comments field.    So, bottom line, Search will also look in the comments field if you click "filter by all" in the magnifying glass to the left of the search field.   And you can move all tracks that if finds into a song list by double clicking on the blue band.

  • How to tell what fonts are missing in a Photosohp CS5 document?

    Hello!  I have received some work from a graphic designer.  I need to modify some of the text in the document.  When I open the document I get an error message:
    Some text layers might need to be updated before they can be used for vector based output.  Do you want to update these layers now?  [Update] [No]
    If I click [Update] it replaces the font with Myriad Pro.  If I click [No] the text looks the way the designer intended, but I have the exclamation mark-triangle symbol over the layer with the text.  If I try to edit the text I get another warning:
    Editing or rendering the text layer "Text Layer" will cause its layout to change.  Continue?  [Cancel]  [OK]
    The same behavior described above occurs.  If I click [Cancel] I obviously can't edit the text.  If I click [OK] it changes the font to Myriad Pro.
    I would like to determine what font the layer is using.  I could swear that previous versions of Photoshop would tell me what fonts were missing when I opened a document.  I can't use the text tool to select the text without it changing the font.  Other posts have mentioned using the text tool to look at the text drop-down to find a greyed-out font which indicates the missing font.  I do not have that.  I only have perhaps 200 fonts installed.  Can anyone tell me how to determine what fonts a .PSD document is using?  I would prefer not to bug the graphic designer if possible.  Thanks much!
    ~ Dan

    Not sure why you are getting ""Font is present on the system but requires a layout change.", usually you do not get that instead the name of the font shows.
    We use extensis Universal Type Client, so the fonts load automatically upon opening files, and never really get missing fonts in Photoshop.
    Actually fontbook has auto font loading if you want to give that a try. Fontbook >> Preferences

  • Hi I am a new iMac user. I got my iTunes on here finally, but now it is telling me I haven't authorized my computer? When I ask @ the app. store- no answers... What did I miss?

    Hi, I am a new iMac user and I finally got my itunes to recognize  my music to the iMac, but now it says my computer is not authorized?! When I ask at the App. store about this- they have nothing, but that is where the iMac sends me? So what did I miss?

    TARDISvt wrote:
    When I click on the apple in the left cornor I get App. Store- but I do not get the choice to authorize?...
    You need to Open iTunes and then click on Store in the Menu Bar.
    See this Discussion...
    https://discussions.apple.com/thread/4631735?tstart=0

  • My Mother in law messed up my Adobe reader some how to the point that it is no longer in my computer. I have tried to download it from the internet but it is not working. What am I missing? what else do I need to do? I am not even able to watch youtube...

    My Mother in law messed up my Adobe reader some how to the point that it is no longer in my computer. I have tried to download it from the internet but it is not working. What am I missing? what else do I need to do? I am not even able to watch youtube...

    Soccerdm,
    a direct download of Adobe Reader X 10.1.4 (which seems to be the most recent standalone version that runs on Mac OS X 10.5.8) is here.

  • I need to upgrade itunes and have 120 gb free space, however, when I go to install it says I'm out of space. The files are only 42 mb. What am I missing?

    When I go to upgrade my itunes software I get a message that I do not have enough space.  My hard drive has 120 gb free and the files are only 42 mb. What am I missing?

    You Hard Drive might be framented or have bad sectors.  Use Windows utility to deframent the drive and Scan Disk for file allocation errors or bad sectors.

  • I USED to see the airplay symbol on my ipad. I don't see it anymore what's wrong? My system is up to date, I reset my Apple TV and everything else I can think of. What am I missing? Please help!

    I USED to see the airplay symbol on my ipad. I don't see it anymore what's wrong? My system is up to date, I reset my Apple TV and everything else I can think of. What am I missing? Please help!

    Did you reboot the router too?

  • What causes the Missing or invalid version of SQL library PSORA (200,0)?

    What causes the Missing or invalid version of SQL library PSORA (200,0) in PeopleTools 8.51 Application Designer?

    Could be several things. Bad path, bad version, etc. give us details on your client install. What Oracle client do you have installed. App Designer is 32 bit. If you installed the 64 bit client you might get this error. What OS are you using. PeopleTools version? guessing 8.51 from your other post.

  • Pages 4.9 will open Appleworks Documents, but I Pages 5 will not.  What am I missing? or is the software just not as good as 4.9?

    Pages 4.3 will open Appleworks Power PC Documents, but I Pages 5 will not.  What am I missing? or is the software just not as good as 4.3?

    "Some users have reported" is a mild way to put it.  To answer your question "or is the software just not as good as 4.3?" more directly... it's only better in transparency between platforms.  Everything else is pretty gutted.  Dozens of features deleted, as listed occassionally in this long thread: https://discussions.apple.com/thread/5468056?tstart=0
    Oh, one other improvement- it DOES run faster, but then of course it would since it's so much more lightweight.

Maybe you are looking for

  • I can't edit my site or even create a new one!

    I created a website on this computer and it was published - somewhat successfully.  The photo albums didn't upload.  But, when I open iWeb, I can't edit the site.  It doesn't even give me the option to create a new site.  My software is up to date

  • DNG Converter filename as original date from EXIF

    Hi there, I like the DNG Converter, except that I would like to use the date from the EXIF information as the filename. That doesn't seem to be possible. Does anybody know of a(nother) way of doing this? Thanks! Regards, D.M.

  • Direct Connectivity to systems source

    Please i have a question: Should the OWB Client (Design component) have direct connection to the system sources, to import metadata, or the import will be executed from server_Repository(design), in this case only the server_side must be connected to

  • FF7B - Liquidity Forecast

    FF7B - Liquidity Forecast Hello, does anyone have a documentation for the above transaction? Do you know how the program works? Thanks and regards, Davide

  • How to capture a screen by using robot class

    how to capture a screen by using robot class