我目前正在使用两个 JSF 1.1 页面。其中一个是 viewDevices.jsp,另一个是 vewDevicesPrint.jsp。它们都在视图范围下运行(即使用 tomahawk savestate)。在 viewDevices 中,它有一个用户可以单击以转到 viewDevicesPrint.jsp 的 img。像这样:
<img src="redesign/images/printicon2.png" alt="print records" border="0" width="16" height="16" onClick="javascript:window.open('/viewDevicesPrint.jsf','_blank','height=500,width=900,menubar=yes, toolbar=yes,scrollbars=yes')"/>
单击此 img 时,我想将 viewDevicesBean 的当前实例传递给 viewDevicesPrintBean。有没有办法做到这一点?
我在 faces-config.xml 中有以下内容。在调试中,viewDevicesPrintBean 正在获取 viewDevicesBean 的新实例,而不是它的当前实例。
<managed-bean>
<managed-bean-name>viewDevicesPrintBean</managed-bean-name>
<managed-bean-class>com.arch.myaccount.jsf.ViewDevicesPrintBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>param_viewDevicesBean</property-name>
<value>#{viewDevicesBean}</value>
</managed-property>
</managed-bean>
<managed-bean>
<managed-bean-name>viewDevicesBean</managed-bean-name>
<managed-bean-class>com.arch.myaccount.jsf.ViewDevicesBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>param_flow</property-name>
<value>#{param.Flow}</value>
</managed-property>
</managed-bean>