[jboss-user] [JBoss Portal] - JSF using it's tag lib does work for map throws an error on

rkandola do-not-reply at jboss.com
Fri Feb 9 11:40:55 EST 2007


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

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4013750#4013750

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4013750



More information about the jboss-user mailing list