在Servlet中这句话该怎么写?
JScript code
<script type="text/javascript">
window.setTimeout("location.href='/shopping/servlet/ShopServlet';",5000);
</script>
请问各位大神,这句话在Servlet中怎么写?
Java code
PrintWriter out=response.getWriter();
out.println();//括号里该写什么?
------解决方案--------------------
out.println("<script type=\"text/javascript\">");
out.println("window.setTimeout(\"location.href='/shopping/servlet/ShopServlet';\",5000);");
out.println("</script>");