我没有问题,我很好奇。
这是我的JSP中的代码
<%
String email = "User doesn't Exist";
HttpSession mySession = request.getSession();
if (mySession != null){
email = (String) request.getAttribute("email");
}else {
// This request and response were defined in the servlet
request.getRequestDispatcher("login.jsp").forward(request,response);
}
%>
所以正如我在标题中所写的问题,JSP 如何知道它们。 如果有任何进一步需要澄清的地方,请询问 C: 预先感谢您的关注和时间。
它们是 JSP 隐式对象。
这些对象是由 JSP 引擎在转换阶段(当 JSP 转换为 servlet 时)创建的。隐式对象是 JSP 规范为开发人员提供的一组 Java 对象,用于访问和操作与特定请求、响应、会话等相关的数据。