You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Sebastien Boutte <s....@eca-assurances.com> on 2006/02/22 12:22:46 UTC

Access Alias Value from JSP Code

Hi all,

I would like to access an alias bean from a jsp code how can i do that ?
Any Ideas ?

Thanks a lot

Sébastien Boutte

My first page is :

<t:aliasBean alias="#{monbean2}" value="#{monbean1}">
   <jsp:include page="page2.jsp">
</t:aliasBean>

My second Page:

<%
  Object value = retrieveMethod("monBean2");
%>
jsf code

I try several methods but all return null value:

1.

FacesContext ctx = FacesContext.getCurrentInstanc 
e();
ValueBinding actualBean = ctx.getApplication().createValueBinding("#
{bean}")
Object value = actuabean.getValue(...);

2.

(String) FacesContext.getCurrentInstance().getExternalContext
().getSessionMap().get(bean); 

3.

FacesContext.getCurrentInstance().getExternalContext().getRequestMap
().get(bean);

4.

FacesContext.getCurrentInstance(). getExternalContext
().getRequestParameterMap().get(bean);