请求参数与请求属性的区别

2019-02-14  本文已影响0人  农民工__乔Young

这个问题对于J2EE的初学者都会遇到,那么下面就从数据传递方向和用法简单聊一下,个人拙见!
相同点:二者都是封装在request中
param: JSP-->Servlet [客户端]
String getParameter(String name),即只能返回String类型数据。 setParameter()这一说。
attribute:Servlet-->Servlet/JSP [容器内]
void setAttribute(String name,Obejct o);
Object getAttribute(String name);
先在request中set,然后才能在request中get

上一篇 下一篇

猜你喜欢

热点阅读