3 Replies Latest reply on Feb 12, 2007 11:02 AM by ssilvert

    JSF using it's tag lib does work for map throws an error on

    rkandola

      Hi,

      I am trying to use JSF tag lib to access a Map. Below is the code JSF code :

      <f:view >
      <h:form>
      <h:panelGrid columns="1">
      <h:inputText value="#{settings.map['foo']}" />
      <h:outputText rendered="#{settings.map['foo'] != null}" value="foo is #{settings.map['foo']}" />
      <h:panelGrid columns="2">
      <h:commandButton action="" value="Go" />
      <h:commandButton action="#{settings.reset}" value="Reset" />
      </h:panelGrid>
      <h:messages showDetail="true" style="color:red"/>
      </h:panelGrid>
      </h:form>
      </f:view>

      setting is session scoped var :

      <managed-bean>
      <managed-bean-name>setting</managed-bean-name>
      <managed-bean-class>MyMap</managed-bean-class>
      <managed-bean-scope>session</managed-bean-scope>
      </managed-bean>

      The backing bean code :

      public class MyMap {
      private Map map;
      /** Creates a new instance of MyMap */
      public MyMap() {
      reset();
      }

      public Map getMap() {
      return map;
      }

      public void setMap(Map map) {
      this.map = map;
      }

      public void reset()
      {
      map = new HashMap();
      }

      }

      This works in Tomcat5.5 using JSF, but for some reason this getting error in the Portal 2.6. Could some please tell why this is the case ?

      Thank you

      Ranbir