<jsp:include > 动态包含
<jsp:forward> 请求转发
<jsp:param> 设置请求参数
<jsp:useBean> 创建一个对象
<jsp:setProperty> 给指定的对象属性赋值
<jsp:getProperty> 取出指定对象的属性值
代码Demo |
<% Student stu = new Student(); stu.setName("tom"); out.print(stu.getName()); %> <jsp:useBean id="stu1" class="com.itheima.entity.Student"></jsp:useBean> <jsp:setProperty property="name" name="stu1" value="jerry"/> <jsp:getProperty property="name" name="stu1"/> <!-- http://localhost:8080/day11_02_jsp2/6.jsp?name=123 --> <jsp:forward page="/7.jsp"><!-- 等价于request.getRequestDispatcher("/7.jsp").forward(request, response); --> <jsp:param value="123" name="name"/> <jsp:param value="333" name="pwd"/> </jsp:forward> |
时间: 2024-10-11 22:01:24