我用我的Servlet下面的代碼來設置屬性confirmMsg:值傳遞
req.setAttribute("confirmMsg", "Update Values");
這我轉發到JSP
RequestDispatcher rd = req.getRequestDispatcher("displayDetails.jsp");
rd.forward(req, resp);
在我的JSP中,我需要在頁面加載時顯示消息。
<body onload = "showConfirmMsg();">
// .....
</body>
我應該在下面的函數中做些什麼,以便顯示消息onload本身?
function showConfirmMsg() {
// Code to show the alert box onload
}
這種情況現在仍然推薦嗎? – Perdomoff 2016-02-11 20:28:25