request中的方法的一些注意事项

1     .setAttribute()在Request域中存储数据

       getAttribute()是获取域中存储的数据

2.     request.getAttribute() 是在页面中获取后台传递来的数据。其返回的数据类型是Object

       request.getParameter方法主要是后台获取前台页面出传递过来的数据。其返回的数据类型时字符串

       注: getParameter()是获取不到前台页面中setAttribute()的值的。

3.     request.setAttribute只能在当前一次request中有效

猜你喜欢

转载自www.cnblogs.com/ws-sharecode/p/12764529.html