摘要:
example.jsp代码:<%@ page language="java" pageEncoding="UTF-8"%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head> <title>My JSP 'index.jsp' starting page</title><meta http-equiv="pragma" co 阅读全文
摘要:
两种转向的区别: forward() request.setAttribute("message", message);request.getRequestDispatcher("/addResult.jsp").forward(request, response); sendRedirect()response.sendRedirect("/guestbook6/getMessages.jsp");区别:1、forward可以读取转向前request对象通过setAttribute()方法所设定的属性值,sendRedirect() 阅读全文