1 Reply Latest reply on Mar 3, 2011 6:09 PM by boy18nj

    How to map a BitSet on facesconfig.xml

    dracola24

      Hello, I want to map this bean in my facesconfig.xml

       

          public class VisualizationBean {

       

              private BitSet results;

       

              public BitSet getResults() {

                  return results;

              }

       

              public void setResults(BitSet results) {

                  this.results = results;

              }

       

          }

       

      As I saw in [some articles][1] and some examples, it is possible to initialize maps or other fields, but I can't figure out how to initialize this fiel. I guess something similar to

       

           <managed-bean>

                  <managed-bean-name>visualizationBean</managed-bean-name>

                  <managed-bean-class>path.bean.VisualizationBean</managed-bean-class>

                  <managed-bean-scope>request</managed-bean-scope>

                  <managed-property>

                      <property-name>results</property-name>

                      <map-entries>

                          <map-entry>

                              <key>true</key>

                              <value>6</value>

                          </map-entry>

                          <map-entry>

                              <key>false</key>

                              <value>12</value>

                          </map-entry>

                          <map-entry>

                              <key>false</key>

                              <value>24</value>

                          </map-entry>               

                      </map-entries>

                  </managed-property>       

              </managed-bean>

       

      But htis is not correct. Any help??

      Thanks in advance

        • 1. How to map a BitSet on facesconfig.xml
          boy18nj

          if you are setting custom bean property then do something like this-

           

          <managed-bean>

          <managed-bean-name>user</managed-bean-name>

          <managed-bean-class>com.corejsf.UserBean</managed-bean-class>

          <managed-bean-scope>session</managed-bean-scope>

          <managed-property>

          <property-name>name</property-name>

          <value>troosevelt</value>

          </managed-property>

          <managed-property>

          <property-name>password</property-name>

          <value>jabberwock</value>

          </managed-property>

          </managed-bean>

           

          Map example-

           

          <map-entries>

          <key-class>java.lang.Integer</key-class>

          <map-entry>

          <key>1</key>

          <value>George Washington</value>

          </map-entry>

          <map-entry>

          <key>3</key>

          <value>Thomas Jefferson</value>

          </map-entry>

          <map-entry>

          <key>16</key>

          <value>Abraham Lincoln</value>

          </map-entry>

          <map-entry>

          <key>26</key>

          <value>Theodore Roosevelt</value>

          </map-entry>

          </map-entries>

           

           

          List example-

           

          <list-entries>

          <value-class>java.lang.Integer</value.class>

          <value>3</value>

          <value>1</value>

          <value>4</value>

          <value>1</value>

          <value>5</value>

          </list-entries>