JSF expressions can access stuff in the http session fine.

When expression #{foo} is encountered, JSF does this:
(1) look in the request-scope vars for name "foo"
(2) look in the http-session vars for name "foo"
(3) look in the app-scope vars for name "foo"
(4) look for a managed-bean declaration for "foo" and if found create an instance and put it in whatever scope was declared.
(5) report an error

The first 3 steps are identical to the JSP variable lookup. The var scopes are the same ones used by JSP. If there is an entry for "foo" in the http session then it will be found, regardless of what code put it there.

Note however that JSF does not have any equivalent to the JSP "page scope". That's a JSP-specific feature that is not in the servlet spec and is not accessable to anything other than JSP code.

Regards,

Simon

netfish wrote:
Simon,
Thanks for your answer, after reading it and googling around a bit more
things are getting clearer.  But even with dataList, is it possible at all
to get a Arraylist object stored in session as its value?  The JSTL tags
have no issues with this (using ${..}).  The list i'd like to iterate over
is not a managed bean at this point and its just stored in the session
scope.

---------------------------->>>>>
Firstly, avoid using c:forEach with JSF1.1. The JSTL tags do NOT work well with JSF in general, and c:forEach is particularly incompatible (this is fixed with JSF1.2 I believe). Use t:dataList instead.

Secondly, the JSF tags don't accept JSP expressions ("${..}") in attributes, only the JSF "#{...}" form. For example, the myfaces_core.tld file has:

  <tag>
   <name>param</name>
   ....
   <attribute>
      <name>value</name>
      <required>true</required>
      <rtexprvalue>false</rtexprvalue>
      <type>java.lang.String</type>
      <description>The value of this parameter.</description>
   </attribute>
  </tag>

Note that rtexprvalue is false, ie no JSP expressions are permitted.

However the JSF form #{..} should be able to do what you want. Remember that JSF is not JSP. It's a different way of thinking, and just supports JSP as one of the possible "templating" systems.

Regards,

Simon





Reply via email to