This content has been marked as final.
Show 7 replies
-
1. Re: seam param passing problem
wespe Dec 15, 2008 10:33 PM (in response to wespe)Forgot this one:
@Name("userHome") public class UserHome extends EntityHome<User> { @RequestParameter Long userId; @Override public Object getId() { if (userId == null) { return super.getId(); } else { return userId; } } ... }
-
2. Re: seam param passing problem
wespe Dec 15, 2008 10:35 PM (in response to wespe)You might need this also:
@Name("currentUser") public class CurrentUser { @Logger Log log; @Out(scope=ScopeType.SESSION) private Long currentUserId; @Observer(JpaIdentityStore.EVENT_USER_AUTHENTICATED) public void authenticatedUser(User user) { log.info("Authenticated user " + user.getUsername()); currentUserId = user.getId(); } }
-
3. Re: seam param passing problem
wespe Dec 15, 2008 11:47 PM (in response to wespe)Experimenting around now I'm getting a new error with this rule:
<rule if-outcome="editUser"> <redirect view-id="/editUser.xhtml"> <param name="userId" value="#{currentUserId}" converter="javax.faces.converter.LongConverter" /> </redirect> </rule>
Error:
23:43:43,484 WARN [Param] could not create converter for: userId
java.lang.ClassCastException: java.lang.String cannot be cast to javax.faces.convert.ConverterString? WTF? :)
-
4. Re: seam param passing problem
abafna.bafna.amit.gmail.com Dec 16, 2008 12:58 AM (in response to wespe)Change converter on param to
converterId="javax.faces.Long"
-
5. Re: seam param passing problem
wespe Dec 16, 2008 1:59 AM (in response to wespe)Thanks for the reply but this didn't help.. I get the same error message.
-
6. Re: seam param passing problem
abafna.bafna.amit.gmail.com Dec 16, 2008 2:43 AM (in response to wespe)I once faced the same exception when I used
converter
instead ofconverterId
and changing it appropriately fixed my problem. If you've changed it and still does not fix the issue, I am sorry I could not be of ore help.Cheers!!!
Amit
-
7. Re: seam param passing problem
wespe Dec 16, 2008 11:53 AM (in response to wespe)Shhhh*t....... :)
Sorry Mate!
I made a mistake again..
Your solution seems just perfect!Thank you very much!
Gabor