<html>
<%!
public void jspInit() {
ServletContext context = getServletContext();
context.setAttribute("What","Hello JSP");
}
%>
<%
ServletContext context = getServletContext();
%><%=context.getAttribute("What")%>
</html>
<%!
public void jspInit() {
ServletContext context = getServletContext();
context.setAttribute("What","Hello JSP");
}
%>
<%
ServletContext context = getServletContext();
%><%=context.getAttribute("What")%>
</html>
而且可以在<context></context>下配置相关参数!但由于书不在身边,我只能给你一个提示,具体要去看书!
这样,就不用频繁连接数据库了
针对用户个人的查询,每个用户还是应该建立自己的连接吧。/