myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Kitching <>
Subject Re: JavaScript alert() window
Date Thu, 10 Nov 2005 21:56:00 GMT
Yee CN wrote:
> I think the parsing rules must be:
> - JSF EL binding expressions only works within jsf tags
> - jsf tags evaluation take precedence over jsp and html tags
> I just recalled that JSP EL works with JSF managed beans. The following
> should work. Take note that it is $, not #.
> <body onload="displayMessage('${mainMenu.alertMessage}')">

This will work when the mainMenu bean already exists, because JSF stores 
any managed bean objects into the request/session/app scope. The JSP EL 
looks in page/request/session/app for objects so will find it.

However if this is the first reference to the mainMenu object, then 
using #{...} syntax will cause the object to be created, while ${...} 
syntax will just fail as JSP doesn't know about managed beans.



View raw message