I was just reading this thread with interest, but it didn't come to the conclusion that I need.
http://forum.java.sun.com/thread.jsp?forum=427&thread=441432
In that thread, there were two screens: a table of links to employees and an "edit employee" page. The solution was to use the command_action on the list create an "employee data" bean, which could then be edited on the "edit employee" page.
My problem is that I need to create some session beans based on query parameters in the URL. Using the example above, I'd have something like: http://localhost/app/editEmployee?empNo=38
Why? Because the user can bookmark the edit employee page, have two
browser windows open (which would require two seperate employee data beans), etc... and we need to handle that. It looks like
that means I can't use the solution in the above thread.
My current thought is to create a managed-bean with request scope and have it create the EmployeeData bean.
Another idea is to somehow initialize the bean with managed-properties
<managed-bean>
<managed-bean-name>EmpBean</managed-bean-name>
<managed-bean-class>com.mycompany.EmpBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>employeeID</property-name>
<value-ref>queryParamBean</value-ref>
</managed-property>
</managed-bean>
<!--
just returns FacesContext.getCurrentInstance().getServletRequest().getParameter("id")
-->
<managed-bean>
<managed-bean-name>queryParamBean</managed-bean-name>
<managed-bean-class>com.mycompany.QueryParamBean</managed-bean-class>
<managed-bean-scope>none</managed-bean-scope>
but that seems kinda hacky. Any other ideas?