1.定时刷新
respond对象.setHeader("refresh", "秒数;url=路径名称"); // 注意,秒数写数字,路径要从项目名开始写起
2.上下文
Servlet中有一个默认的对象,可以管理当前项目下的所有Servlet,该对象叫做ServletContext
获取对象方法:
ServletContext context = this.getServletContext();
设置全局参数:
context.setAttribute("key", "value");
获取全局参数:
context.getAttribute("key", "value");
3.注意:
html页面中,表单的提交路径 action="路径" 路径要从项目名写起。