11 Replies Latest reply on Mar 2, 2009 1:23 PM by Suruchi Sahni

    Static data

    Suruchi Sahni Newbie

      I have a list of static data to be shown in dropdown, for ex. states and cities in the country. I have either the option of creating an XML of static data and populating the dropdowns after parsing the XML.


      Can someone suggest me on how to do this with application scope servlet which will be populate some Map at the server startup.


      Please guide me on this.Or any other way to do it.

        • 1. Re: Static data
          Stuart Douglas Master

          You probably want something like this, which sticks a list of cities into application scope on server startup:


          @Startup
          @Scope(APPLICATION)
          @Name("cityList")
          public class CityListManager
          {
          
              List<String> cities;
              @Unwrap
              public List<String> getCities()
              {
                 return cities;
              }
          
              @Create
              public void create()
              {
                //load XML file (or whatever) and stick it into the cities list
          
              }
          
          
          
          }

          • 2. Re: Static data
            Suruchi Sahni Newbie

            Thanks first of all for such a quick reply. Since I am just a beginner, my question can be stupid.


            I need to ask that in create method do I have to write code for XML parsing using SAX or DOM parser or is there any other way.


            Secondly, if I have 2 pages and both the pages have two dropdowns, one for state and one for cities. Firstly city's dropdown is disabled and gets enabled only if we select a state and values in city's dropdown gets changed based on the state selected.
            So do I have to make two such beans , one for state and one for city.


            And how will I refer to these state list and city list in the the two beans related to two pages.


            Thanks a lot once again.

            • 3. Re: Static data
              Stuart Douglas Master

              You have two options, the first is to use the approach I posted above, parsing it with SAX. Stick the states into a List and the cities into a Map<String,List<String>> (assuming you want to represent them as strings and not some other object type).



              @Startup
              @Scope(APPLICATION)
              @Name("stateManager")
              public class CityListManager
              {
              
                  List<String> states;
                  
                  Map<String,List<String>> cities;
              
                  @Create
                  public void create()
                  {
                    //load XML file (or whatever) and stick it into the cities list
              
                  }
              
              
              
              }
              
              .xhtml:
              
              <h:selectOneMenu value="#{myBean.state}" >
                <s:selectItems value="#{stateManager.states}" var="i" label="#{i}" />
              </h:selectOneMenu>
              
              <h:selectOneMenu value="#{myBean.city}" enabled="#{myBean.state != null}" >
                <s:selectItems value="#{stateManager.cities[myBean.state]}" var="i" label="#{i}" />
              </h:selectOneMenu>
              
              





              You could also do something like this:



              public class StateController
              {
                List<State> states;
                //getter & setter
              
              }
              
              public class State
              {
                List<String> cities;
                //getter and setter
              
                String stateName;
              
              }
              
              Then in components.xml:
              
              <component name="NSW" class="com.mypackage.State" >
               <property name="cities" >
                 <value>Sydney</value>
                 <value>Newcastle</value>
                 .....
               </property>
               <property name="stateName" >
                 New South Wales
               </property
              </component>
              
              <component name="allStates" class="com.mypackage.StateController" >
               <property name="states" >
                 <value>#{NSW}</value>
                 <value>#{QLD}</value>
                 .....
               </property>
              </component>
              
              



              This approach means you do not have to edit any xml, however I think the top approach is the most correct.

              • 4. Re: Static data
                Suruchi Sahni Newbie
                Thanks once again.

                I tried second solution, may be because I find it easier. But how to refer to it in .xhtml.

                I made two classes as you suggested and placed a @Name annotation on both to refer them in .xhtml. But I got the following error :

                `java.lang.IllegalArgumentException: Expected a child component type of UISelectItem/UISelectItems for component type javax.faces.SelectOne(state).  Found null.
                        at com.sun.faces.renderkit.RenderKitUtils.getSelectItems(RenderKitUtils.java:357)
                        at com.sun.faces.renderkit.html_basic.MenuRenderer.getOptionNumber(MenuRenderer.java:675)
                        at com.sun.faces.renderkit.html_basic.MenuRenderer.renderSelect(MenuRenderer.java:793)
                        at com.sun.faces.renderkit.html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:335)
                        at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:833)
                        at javax.faces.component.UIComponent.encodeAll(UIComponent.java:896)
                        at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
                        at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:809)
                        at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
                        at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
                        at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
                        at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
                        at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:196)
                        at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
                        at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                        at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
                        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
                        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                        at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                        at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
                        at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                        at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
                        at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                        at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                        at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                        at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                        at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                        at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
                        at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
                        at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
                        at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
                        at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
                        at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                        at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                        at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                        at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
                        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
                        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
                        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
                        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                        at java.lang.Thread.run(Thread.java:595)
                `

                Please refer to following code:

                in .xhtml
                `
                <h:selectOneMenu id="state" value="#{reverseAddress.selectedState}">
                <a:support event="onchange"  reRender="city,errorMsg"></a:support>
                <s:selectItems value="#{stateController.states}" var="i" label="#{i}" />
                </h:selectOneMenu>

                <h:selectOneMenu id="city" value="#{reverseAddress.cityField}" disabled="#{reverseAddress.selectedState==null}">
                <s:selectItems value="#{stateClass.cities}"  var="j" label="#{j}"/>
                </h:selectOneMenu>
                `

                Components.xml
                `
                <?xml version="1.0" encoding="UTF-8"?>
                <components xmlns="http://jboss.com/products/seam/components"
                            xmlns:core="http://jboss.com/products/seam/core"
                            xmlns:security="http://jboss.com/products/seam/security"
                            xmlns:transaction="http://jboss.com/products/seam/transaction"
                            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                            xsi:schemaLocation=
                                "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
                                 http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.0.xsd
                                 http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.0.xsd
                                 http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd">

                    <core:init jndi-pattern="@jndiPattern@" debug="true"/>

                    <core:manager conversation-timeout="120000"
                                  concurrent-request-timeout="500"
                                  conversation-id-parameter="cid"/>

                    <transaction:ejb-transaction/>

                    <security:identity authenticate-method="#{authenticator.authenticate}"/>
                <component name="Rajasthan" class="common.com.mypackage.State" >
                     <property name="cities" >
                        <value>Bikaner</value>
                        <value>Jaisalmer</value>
                     </property>
                <property name="stateName" >
                   Rajasthan
                </property>
                </component>
                <component name="Karnataka" class="common.com.mypackage.State" >
                     <property name="cities" >
                        <value>Coorg</value>
                        <value>ABC</value>
                     </property>
                <property name="stateName" >
                   Karnataka
                </property>
                </component>

                <component name="allStates" class="common.com.mypackage.StateController" >
                <property name="states" >
                   <value>#{Rajasthan}</value>
                   <value>#{Karnataka}</value>
                </property>
                </component>
                </components>
                `

                StateController.java
                `
                @Name("stateController")
                public class StateController {
                   List<State> states;

                //Getter and setters
                }
                `

                State.java
                `
                @Name("stateClass")
                public class State {
                    List<String> cities;

                    String stateName;

                //Getter and setters
                }

                `

                Please help. I tried to format it but was unable to do so. Sorry for that.
                • 5. Re: Static data
                  Stuart Douglas Master

                  Don't worry about @Name, at the moment you have two components, stateCotroller and allStates, stateController has an empty list of cities, which is why you are getting that exception. When you define the component is components.xml with a new name you get a completly new component  Change your xhtml to something like:



                  <h:selectOneMenu id="state" value="#{reverseAddress.selectedState}">
                   <a:support event="onchange" reRender="city,errorMsg"></a:support>
                   <s:selectItems value="#{allStates.states}" var="i" label="#{i}" />
                  </h:selectOneMenu>
                  <a4j:outputPanel id="city" >
                  <h:selectOneMenu  value="#{reverseAddress.cityField}" disabled="#{reverseAddress.selectedState==null}">
                   <s:selectItems value="#{reverseAddress.selectedState.cities}" var="j" label="#{j}"/>
                  </h:selectOneMenu>
                  
                  </a4j:outputPanel>
                  
                  
                  



                  I have had a few beers though, so no guarentees.


                  Stuart

                  • 6. Re: Static data
                    Suruchi Sahni Newbie

                    I tried it but getting the following error :


                    java.lang.IllegalArgumentException: Expected a child component type of UISelectItem/UISelectItems for component type javax.faces.SelectOne(j_id34).  Found null.
                         at com.sun.faces.renderkit.RenderKitUtils.getSelectItems(RenderKitUtils.java:357)
                         at com.sun.faces.renderkit.html_basic.MenuRenderer.getOptionNumber(MenuRenderer.java:675)
                         at com.sun.faces.renderkit.html_basic.MenuRenderer.renderSelect(MenuRenderer.java:793)
                         at com.sun.faces.renderkit.html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:335)
                         at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:833)
                         at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:286)
                         at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
                         at org.ajax4jsf.renderkit.html.AjaxOutputPanelRenderer.encodeChildren(AjaxOutputPanelRenderer.java:78)
                         at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:809)
                         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
                         at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
                         at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:809)
                         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
                         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
                         at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
                         at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
                         at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:196)
                         at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
                         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                         at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
                         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                         at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
                         at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
                         at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
                         at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
                         at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
                         at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
                         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
                         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
                         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                         at java.lang.Thread.run(Thread.java:595)
                    
                    



                    Here is my code after changes :



                    .xhtml


                         <td>
                                                    <h:selectOneMenu id="state" value="#{reverseAddress.selectedState}">
                                                    <a:support event="onchange"  reRender="city,errorMsg"></a:support>
                                                    <s:selectItems value="#{allStates.states}" var="i" label="#{i}" />
                                                </h:selectOneMenu>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <b> City : </b>
                                                </td>
                                                <td>
                                                    <a:outputPanel id="city" >
                                                    <h:selectOneMenu value="#{reverseAddress.cityField}" disabled="#{reverseAddress.selectedState==null}">
                                                        <s:selectItems value="#{reverseAddress.selectedState.cities}"  var="j" label="#{j}"/>
                                                    </h:selectOneMenu>
                                                    </a:outputPanel>
                                                </td>
                                            </tr>
                    



                    In the bean of the page referred to as reverseAddress :


                     private State selectedState;
                    
                       public void setSelectedState(State selectedState) {
                            this.selectedState = selectedState;
                        }
                    
                        public State getSelectedState() {
                            return selectedState;
                        }
                    



                    State.java


                    public class State {
                        List<String> cities;
                    
                        String stateName;
                    
                        public List<String> getCities() {
                            return cities;
                        }
                    
                        public void setCities(List<String> cities) {
                            this.cities = cities;
                        }
                    
                        public String getStateName() {
                            return stateName;
                        }
                    
                        public void setStateName(String stateName) {
                            this.stateName = stateName;
                        }
                    
                        
                    }
                    



                    StateController.java


                    public class StateController {
                       List<State> states;
                    
                        public List<State> getStates() {
                            return states;
                        }
                    
                        public void setStates(List<State> states) {
                            this.states = states;
                        }
                    }
                    



                    components.xml


                    <?xml version="1.0" encoding="UTF-8"?>
                    <components xmlns="http://jboss.com/products/seam/components"
                                xmlns:core="http://jboss.com/products/seam/core"
                                xmlns:security="http://jboss.com/products/seam/security"
                                xmlns:transaction="http://jboss.com/products/seam/transaction"
                                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                                xsi:schemaLocation=
                                    "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
                                     http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.0.xsd
                                     http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.0.xsd
                                     http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd">
                    
                        <core:init jndi-pattern="@jndiPattern@" debug="true"/>
                    
                        <core:manager conversation-timeout="120000"
                                      concurrent-request-timeout="500"
                                      conversation-id-parameter="cid"/>
                    
                        <transaction:ejb-transaction/>
                    
                        <security:identity authenticate-method="#{authenticator.authenticate}"/>
                    <component name="Rajasthan" class="common.com.State" >
                         <property name="cities" >
                            <value>Bikaner</value>
                            <value>Jaisalmer</value>
                         </property>
                     <property name="stateName" >
                       Rajasthan
                     </property>
                    </component>
                    <component name="Karnataka" class="common.com.State" >
                         <property name="cities" >
                            <value>Coorg</value>
                            <value>ABC</value>
                         </property>
                     <property name="stateName" >
                       Karnataka
                     </property>
                    </component>
                    
                    <component name="allStates" class="common.com.StateController" >
                     <property name="states" >
                       <value>#{Rajasthan}</value>
                       <value>#{Karnataka}</value>
                     </property>
                    </component>
                    </components>
                    



                    Please help. This is really a small issue but I m not able to make it work.

                    • 7. Re: Static data
                      Stuart Douglas Master

                      The problem is with the second dropdown, the list is null until you select the first item, and jsf complains. Use rendered rather than disabled as I did in my example.

                      • 8. Re: Static data
                        Suruchi Sahni Newbie

                        It worked, but I am getting the following in the States dropdown :


                        common.com.State@75d86b
                        and
                        common.com.State@d38525 
                        



                        instead I should get names of states like Rajasthan and Karnatka, which I entered in Components.xml.


                        I replaced the code in .xhtml for the first dropdown with following (I replaced the allStates.states with allStates.states.stateName) :


                                                        <h:selectOneMenu id="state" value="#{reverseAddress.selectedState}">
                                                        <a:support event="onchange"  reRender="city,errorMsg"></a:support>
                                                        <s:selectItems value="#{allStates.states.stateName}" var="i" label="#{i}" />
                                                    </h:selectOneMenu>
                        



                        But with this I got the following error :


                        java.lang.NumberFormatException: For input string: "stateName"
                             at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
                             at java.lang.Integer.parseInt(Integer.java:447)
                             at java.lang.Integer.parseInt(Integer.java:497)
                             at javax.el.ListELResolver.coerce(ListELResolver.java:166)
                             at javax.el.ListELResolver.getValue(ListELResolver.java:51)
                             at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
                             at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
                             at org.jboss.el.parser.AstPropertySuffix.getValue(AstPropertySuffix.java:53)
                             at org.jboss.el.parser.AstValue.getValue(AstValue.java:67)
                             at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
                             at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
                             at javax.faces.component.UISelectItems.getValue(UISelectItems.java:130)
                             at org.jboss.seam.ui.component.UISelectItems.getValue(UISelectItems.java:156)
                             at com.sun.faces.renderkit.RenderKitUtils.getSelectItems(RenderKitUtils.java:323)
                             at com.sun.faces.renderkit.html_basic.MenuRenderer.getOptionNumber(MenuRenderer.java:675)
                             at com.sun.faces.renderkit.html_basic.MenuRenderer.renderSelect(MenuRenderer.java:793)
                             at com.sun.faces.renderkit.html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:335)
                             at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:833)
                             at javax.faces.component.UIComponent.encodeAll(UIComponent.java:896)
                             at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
                             at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:809)
                             at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
                             at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
                             at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
                             at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
                             at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:196)
                             at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
                             at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                             at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
                             at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
                             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                             at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                             at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
                             at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                        
                        

                        • 9. Re: Static data
                          Suruchi Sahni Newbie

                          Do I have to a converter??

                          • 10. Re: Static data
                            Suruchi Sahni Newbie
                            In .xhtml I changed to following ,

                            label="#{i.stateName}"

                            which now shows the desired values ie Rajasthan and Karnatka

                            but when I change the value in the dropdown I get following exception :


                            Conversion error setting value 'common.com.State@12cg34' for 'null Converter'.
                            • 11. Re: Static data
                              Suruchi Sahni Newbie

                              One out the way question. Please do answer this question.Please.


                              If in case states and cities in a country changes. Then does implementing through components.xml will again need building the project and again deploying the project.


                              Or server can directly take the changed values through components.xml just after server startup.


                              As in the first approach through SAX parser etc. I think only server startup is required after changing the XML.


                              Hope I am clear.


                              Please let me know.