データベースを更新したときにサーバーからクライアントに通知をプッシュしたい。
これは私のコントローラーです:
public function finish() {
$this->autoRender = false;
try {
if($this->request->is('post')) {
$db = $this->ClientCabaInfo->getDataSource();
if($this->Session->check('client_check_data')) {
$data = $this->Session->read('client_check_data');
...
if($this->CabaInfo->save()) {
$this->webNotify();
}
}
$this->redirect('index');
}
} catch (Exception $e) {
$this->EasyLog->log(Conf::r("APP.LOG.APP_FILE"),$e->getMessage(),Conf::r("COM.LOG.FORMAT_ERROR"),'NASUCT');
$this->redirect("/errors/");
}
}
public function webNotify() {
header('Content-Type: text/event-stream');
header('Cache-Control: no-cache');
$time = date('r');
echo "data: {$time}";
flush();
}
そして私の見解では、私は次のように呼びました:
if(typeof(EventSource)!=="undefined")
{
var source=new EventSource("<?php echo $this->Html->url('/client_caba/finish'); ?>");
source.onmessage=function(event)
{
notifyMe(event.data);
};
}
else
{
document.getElementById("result").innerHTML="Sorry, your browser does not support server-sent events...";
}
しかし、ページにアクセスするhttp://localhost:8080/admin/client_caba/finish
と、ダイアログが表示され、アクションが終了しません...

どこが間違っていますか?そして、この問題を解決し、パラメータをポップアップ通知に渡す方法を教えてください...ありがとう