I'm using the @Unwrap to return the logged in user entity (to avoid any lazy
initialization issues). However, when a user is not logged in I want the
@Unwrap method to return null, which I do, and seam ignores it.
Looking at the SeamVariableResolver class (below) line 44 correctly unwraps the
component to null. However, the variable resolver (line 46) interprets a null
value as the component not existing and then loads the seam component as a
managed bean (line 45).
Am I doing something wrong or is this a bug?
Thanks in advance, Peter.
| 39 public Object resolveVariable(FacesContext facesContext, String name)
throws EvaluationException
| 40 {
| 41 name = name.replace('$', '.');
| 42
| 43 log.debug("resolving name: " + name);
| 44 Object component = Component.getInstance(name, true);
| 45 Object managedBean =
jsfVariableResolver.resolveVariable(facesContext, name);
| 46 if (component==null)
| 47 {
| 48 if (managedBean==null)
| 49 {
| 50 log.debug("could not resolve name");
| 51 return null;
| 52 }
| 53 else {
| 54 log.debug("resolved name to managed bean");
| 55 return managedBean;
| 56 }
| 57 }
| 58 else
| 59 {
| 60 //TODO: fix and re-enable
| 61 /*if ( managedBean!=null && managedBean!=component )
| 62 {
| 63 log.warn("Seam component hides managed bean with same name");
| 64 }*/
| 65 log.debug("resolved name to seam component");
| 66 return component;
| 67 }
| 68 }
|
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3955529#3955529
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3955529
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user