[JBoss Seam] - Re: Can EntityConverter handle different EntityManagers?
by wiberto
I tried doing this in the xhtml itself:
| <s:convertEntity entityManager="#{anotherEntityManager}" />
|
and it still wanted to go look for entityManager. Actually it gives that error if the variable name is not the same as the component name. If it I get this error:
| Caused by: java.lang.IllegalArgumentException: Cannot convert org.jboss.seam.persistence.EntityManagerProxy@41d260 of type class org.jboss.seam.persistence.EntityManagerProxy to interface org.jboss.seam.core.Expressions$ValueExpression
| at org.jboss.el.lang.ELSupport.coerceToType(ELSupport.java:358)
| at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:188)
| at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
| at com.sun.facelets.tag.TagAttribute.getObject(TagAttribute.java:233)
| ... 78 more
|
Any ideas?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4093805#4093805
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4093805
18Â years, 8Â months
[JBoss Seam] - non-void property setters
by roger_goldman2000
Is there any particular reason why the property setters are restricted to having a 'void' return type?
It is sometimes convenient to have a class like:
| @Name(user)
| public class User {
| private String username;
| private String password;
|
| public String getUsername() { return this.username; }
| public User setUsername( String u ) { this.username = u; return this; }
| public String getPassword() { return this.password; }
| public User setPassword( String p ) { this.password = p; return this; }
| }
|
so that you can then do:
| ...
| User user = new User().setUsername("rag").setPassword("s3cr3t");
| ...
|
Unfortunately, when we try to reference #{user.username}, we get
value="#{user.username}": Property 'username' not writable on type java.lang.String.
Thoughts?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4093801#4093801
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4093801
18Â years, 8Â months