太晕了,一直以为这两个是同样的方法呢,今天在前台添加了参数<param, 用getRequestMap()死活得不到,才想到查查这两个方法的区别:与JSP的getParameter/getAttribute相同
FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
FacesContext.getCurrentInstance().getExternalContext().getRequestMap();
The first contains all request parameters which are set by
the client. The server can get them but cannot change it.
The second contains
all request attributes which are set/controlled by the server. The client has no
control over it.
本文解析了JSF中FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap()与FacesContext.getCurrentInstance().getExternalContext().getRequestMap()的区别。前者包含客户端设置的所有请求参数,服务器可以获取但不能更改;后者包含服务器设置或控制的所有请求属性,客户端无法控制。
8908

被折叠的 条评论
为什么被折叠?



