passing url paramters

Hello,

I have a session scope managed bean to which I would like to pass a url parameter. I have the following in faces-context.xml

<managed-bean>

<managed-bean-name>myBean</managed-bean-name>

<managed-bean-class>voip.myPackage.myBeanClass</managed-bean-class>

<managed-bean-scope>session</managed-bean-scope>

<managed-property>

<property-name>myId</property-name>

<value>#{param.myId}</value>

</managed-property>

</managed-bean>

when using the URL http://www.mydomain.com/myPage.jsf?myId=1

I receive a scope cycle error.

How do I solve this problem without using a request scoped bean?

[714 byte] By [kev9023a] at [2007-11-27 10:38:13]
# 1

The fundamental issue here is that a managed beans property are only initialized once; so that if JSF did allow you to do what you are trying to do, you wouldn't get the result you wanted anyways.

First, why are you opposed to request scoped beans? You should prefer request scope beans over session scope beans for performance reasons.

Second, you can access the request parameters directly via the ExternalContext, available from the FacesContext.

RaymondDeCampoa at 2007-7-28 18:53:05 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...