1

Is there any way to capture closing of browser or being redirected to other pages at managedBean to do some processes? I know that @PreDestroy is called when the container decides to kill the managedBean. However, that is not quite what I need. I want to do an immediate processing right after the view is changed.

4

1 に答える 1

1

Richfaces の JavaScript イベントと Ajax4JSF を使用します。このコードはBean#callBean、ページがアンロードされるとメソッドを呼び出します。a4j jsfunction の詳細については、こちらを参照してください

<h:body onunload="unload()">

   <a4j:jsFunction name="unload" action="#{bean.callBean}">
   </a4j:jsFunction>
</h:body>
于 2013-10-15T06:59:17.317 に答える