The HttpServletRequest class has both the getAttribute() method and the getParameter() method. The two methods have the following differences:
1. The HttpServletRequest class has a setAttribute() method but no setParameter() method;
2. When there is a link relationship between two Web components, the linked component obtains the request parameters through the getParameter() method;
For example, assuming there is a link relationship between welcome.jsp and authenticate.jsp, there is the following code in welcome.jsp:
3. When there is a forwarding relationship between two Web components, the forwarding target component shares the data within the request range with the forwarding source component through the getAttribute() method.
It is assumed that there is a forwarding relationship between authenticate.jsp and hello.jsp. authenticate.jsp hopes to pass the current user name to hello.jsp. How to pass this data? First call the setAttribute() method in authenticate.jsp: