FacesContext & ServletContext
关键字: context
FacesContext fc = FacesContext.getCurrentInstance();
ExternalContext ec = fc.getExternalContext();
HttpServletRequest servletRequest = (HttpServletRequest)ec.getRequest();
HttpServletResponse servletResponse = (HttpServletResponse)ec.getResponse();
取得 parameter的办法
1)
String key = httpRequest.getParameter( "key" );
String value = httpRequest.getParameter( "value" );
2)
Map request = ex.getRequestParameterMap();
String key = request.get(“key”);
ExternalContext 一些方法
getRequestContextPath(); “/cmp”
getRequestServletPath(); “/ajax”
getRequestPathInfo(); “/invoke/iStoreBean.changeBasic”
ServletContext servletContext = ec.getContext();
servletContext.getRealPath(“/”); file system path
发表评论
- 浏览: 5174 次
- 性别:

- 来自: 厦门

- 详细资料
搜索本博客
我的相册
共 2 张
最近加入圈子
最新评论
-
dojo and ajax
很有用的函数!!
-- by cscs31 -
Dojo 与style相关的函数 ...
Lz能加上一些注解和例子就更好了:)
-- by cscs31






评论排行榜