IceFaces FAQ
From Foochal
Contents |
[edit]
How do I get the servlet context in a jsp
<ice:outputText value="#{facesContext.externalContext.requestContextPath}"/>
[edit]
How do I include a .css or .js file using a relative to context URL
<ice:outputStyle href="#{facesContext.externalContext.requestContextPath}/xmlhttp/css/xp/xp.css" />
<ice:outputStyle href="#{facesContext.externalContext.requestContextPath}/css/my.css" />
[edit]
How do I set cookies
((BridgeExternalContext) FacesContext.getCurrentInstance()
.getExternalContext()).addCookie(new Cookie("test", "test"));
[edit]
How do I get a request parameter
((HttpServletRequest) FacesContext.getCurrentInstance()
.getExternalContext().getRequest()).getParameter(paramName);
[edit]
How do I get all cookies
Cookies[] cookies = ((HttpServletRequest)((BridgeExternalContext)FacesContext
.getCurrentInstance().getExternalContext()).getRequest()).getCookies();
[edit]
How do I redirect
ExternalContext objExternalContext = FacesContext.getCurrentInstance().getExternalContext(); ((HttpServletResponse)objExternalContext.getResponse()).sendRedirect(...

