voyent
ICEfaces/Seam integration EL problems  XML
Forum Index -> JBoss Seam Integration
Author Message
sjmenden

Joined: 04/Dec/2006 00:00:00
Messages: 5
Offline


I just integrated ICEfaces into seam, and the ICEfaces components work that I've tried, but I am now having major Epression Language problems.

Before ICEfaces I had this code in my template.xhtml to determine whether a user was logged in:

Code:
 <li>
 					<h:commandLink value="Logout" rendered="#{loggedIn}" action="#{login.logout}" />
 					<h:outputText rendered="#{!loggedIn}" >
 						<a href="login.seam">Login</a>
 					</h:outputText>
 				</li>
 



when a user first went to my index.seam page which had the above code in it's template, everything would render correctly even though loggedIn was not in the Session context yet.


However, now that I installed ICEfaces both Logout and Login links are getting shown and I see this in my server.log from JBoss:

Code:
 2006-12-04 12:46:56,481 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: loggedIn
 2006-12-04 12:46:56,481 DEBUG [org.jboss.seam.Component] seam component not found: loggedIn
 2006-12-04 12:46:56,481 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
 2006-12-04 12:46:56,481 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: loggedIn
 2006-12-04 12:46:56,481 DEBUG [org.jboss.seam.Component] seam component not found: loggedIn
 2006-12-04 12:46:56,481 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
 2006-12-04 12:46:56,481 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: loggedIn
 2006-12-04 12:46:56,481 DEBUG [org.jboss.seam.Component] seam component not found: loggedIn
 2006-12-04 12:46:56,481 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
 2006-12-04 12:46:56,481 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: loggedIn
 2006-12-04 12:46:56,481 DEBUG [org.jboss.seam.Component] seam component not found: loggedIn
 2006-12-04 12:46:56,481 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
 2006-12-04 12:46:56,481 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: loggedIn
 2006-12-04 12:46:56,481 DEBUG [org.jboss.seam.Component] seam component not found: loggedIn
 2006-12-04 12:46:56,481 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
 
 



I have even tried the following to no avail, still the same problem:

Code:
 <h:commandLink value="Logout" rendered="#{loggedIn != null and loggedIn == true}" 
 



Any ideas or help would be greatly appreciated
philip.breau


Joined: 08/May/2006 00:00:00
Messages: 2989
Offline


Hi,

Is there a bean reference that's supposed to hold the 'loggedIn' property?

Thanks,
Philip

.
sjmenden

Joined: 04/Dec/2006 00:00:00
Messages: 5
Offline


The loggedIn is a boolean value in the session context that gets set when I first log in. I guess as a work around for now I'll try to embed that in my login EJB and initialize it false, although, this is more verbose than a simple #{loggedIn}
philip.breau


Joined: 08/May/2006 00:00:00
Messages: 2989
Offline


I see. Was the el resolution of the session context variable working with Seam before ICEfaces? I wasn't aware that you could do that.

Thanks,
Philip

.
sjmenden

Joined: 04/Dec/2006 00:00:00
Messages: 5
Offline


If I'm not mistaken, the EL will try to resolve an unknown variable in every scope before failing.

Here is a more details view of what is happeneing that is preventing me from using ICEfaces, which I really badly want to implement.

Code:
 <li>
 					<h:commandLink value="Logout" rendered="#{login.loggedIn == true}" action="#{login.logout}" />
 					<h:outputText rendered="#{login.loggedIn == false}" >
 						<a href="login.seam">Login</a>
 					</h:outputText>
 				</li>
 



so now I am directly referencing the loggedIn variable, when I first hit my index.xhtml I put logging code that shows:

Code:
 16:00:53,645 INFO  [LoginAction] Returning false for isAdmin
 16:00:53,647 INFO  [LoginAction] Returning false of isLoggedIn
 



Which is perfect, however, right after I log in, the login link is still being shown along with the logout link (which should be shown). This makes absolutely no sense since the console shows:

Code:
 16:02:38,152 INFO  [LoginAction] Returning true for isAdmin
 16:02:38,155 INFO  [LoginAction] Returning true of isLoggedIn
 



So, according to the variables, I should only be seeing the Logout link not the Login since the method accessor to the loggedIn variable returns true.

Any ideas?
greg.dick

Joined: 26/Oct/2004 00:00:00
Messages: 85
Offline


Just wondering if the loginAction class has been copied from an existing Seam example (say dvdstore), and is still stateless? From the stock DVD store example,

@Stateless
@Name("login")
public class LoginAction
implements Login,
Serializable

And from the Seam document, section 2.2.1

"Stateless session bean components are not able to hold state across multiple invocations. Therefore, they usually work by operating upon the state of other components in the various Seam contexts. They may be used as JSF action listeners, but cannot provide properties to JSF components for display."

The Seam examples do visibility testing on Seam components all the time, and I haven't seen any issues with it yet, other than with JSTL tags not being re-evaluated during partial submits, which is currently to be expected.

If the loginAction is not stateless, it must be something else. Could you sketch out a little more of what it is that used to work?

thank you.
[Email]
sjmenden

Joined: 04/Dec/2006 00:00:00
Messages: 5
Offline


Thank you for your response.

It was Stateless, but I just converted it over to Stateful and I am still observing the same behavior:

Use to Work with Regular SEAM:
In my template.xhtml page I have a section that should only get rendered if the isAdmin session variable is set to true.

Doesn't work with ICEfaces now:
Now the Admin section gets shown constantly. I even tried to reference the isAdmin as a variable i set in my login EJB like ${login.admin} and the console says returning false for the variable, however the section still gets shown.




Use to Work with Regular SEAM:
A session variable called loggedIn that is set when a user logs in. So in my template.xhtml I have links for Login and Logout. #{loggedIn} to display Logout and #{!loggedIn} to display Login

Doesn't work with ICEfaces now:
Now, initially when I go to my index.xhtml which uses the template.xhtml, only the Login link is being shown, that is fine. But after I log in, then the Login AND Logout links are being shown.




Thank you for taking a look at this.
 
Forum Index -> JBoss Seam Integration
Go to:   
Powered by JForum 2.1.7ice © JForum Team