How to pass variable from jsf managed bean to jsp page
- by cyberziko
How can I pass a variable from JSF managed bean to JSP page.
PS: I'm in portal context (liferay).
I tried this:
in Managed Bean:
HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
request.setAttribute("var", "someTxt");
in JSP:
<%
String var = (String)request.getAttribute("var");
%>
I don't get any result.