How to pass variable from jsf managed bean to jsp page

Posted by cyberziko on Stack Overflow See other posts from Stack Overflow or by cyberziko
Published on 2010-04-28T17:52:19Z Indexed on 2010/04/28 17:57 UTC
Read the original article Hit count: 210

Filed under:
|
|
|
|

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.

© Stack Overflow or respective owner

Related posts about jsf

Related posts about liferay