users@glassfish.java.net

How to set a session and/or request scoped var in JSF jsp

From: Daniel H. Cavalcanti <dhcavalcanti_at_gmail.com>
Date: Wed, 12 Sep 2007 12:21:53 -0400

Hi...

I have a table that display some data. The table has a column with a
link that the user clicks to see the message detail.
I'm trying to pass the message id in the session scope so that I can use
it in the other page and its backing managed bean.

Here is the excerpt...

            <tr:table
                var="message"
                value="#{MessageDisplay.messages}"
                rows="10"
                rendered="#{not empty MessageDisplay.selected}">

                <tr:column>
                    <tr:commandLink text="View" action="message-details">
                        <c:set scope="session" var="id" value="Test
${message['id']}"/>
                        <f:param name="id" value="#{message['id']}"/>
                    </tr:commandLink>
                </tr:column>

                <c:forEach var="header" items="#{MessageDisplay.selected}">
                    <tr:column>
                        <f:facet name="header">
                            <tr:outputText value="#{header}"/>
                        </f:facet>
                        <tr:outputText value="#{message[header]}"/>
                    </tr:column>
                </c:forEach>

            </tr:table>

On the other page, I have the following:

        <tr:outputText value="Message Details"/>
        <tr:outputText value="#{sessionScope['id']}"/>
        <tr:outputText value="#{param['id']}"/>

Only <tr:outputText value="#{param['id']}"/> displays something (but
this is...
However, <tr:outputText value="#{sessionScope['id']}"/> does not display
anything.
I'm using NetBeans, and I started Glassfish with the HTTP monitor turned
on. When I look at the session, nothing is being set...

Am I doing something wrong? Is this a bug?
thanks,
Daniel.