根据条件重新加载网页

时间:2014-04-01 08:16:31

标签: html jsp

我是Web开发的初学者,我正在JSP中创建一个项目。根据tutorialspoint,JSP只能根据预定义的x秒数自动重新加载网页。我希望每次从servlet上下文收到高优先级SIP MESSAGE时重新加载网页,如下面的代码所示:

<%@ page import="java.io.*,java.util.*" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>High priority alert has been received !!!</title>
</head>
 <body>
  <p>
    <%
       if (MESSAGEHighPrio == null) {
           out.println("No high priority alerts have been received yet.");
           String MESSAGELowPrio = (String)this.getServletContext().getAttribute("MESSAGEFromLowPrioSIPServlet");

       }

       else{
           // RELOAD THE PAGE HERE !!!!
           out.println("<h1>High priority alert has been received !!!</h1>");
           out.println("Address: " + MESSAGEHighPrio + "\n");
       }
      %>
</p>

0 个答案:

没有答案