[jboss-user] [JBoss Seam] - is it rich:menuItem bug ?
chlol
do-not-reply at jboss.com
Tue Aug 28 03:27:51 EDT 2007
my menu source code:
<rich:menuItem submitMode="ajax" value="update" action="/UserEdit.xhtml">
<f:param name="userId"
value="#{authenticator.user.id}"/>
</rich:menuItem>
the Authenticator class:
@Name("authenticator")
@Scope(ScopeType.SESSION)
public class Authenticator {
@Logger
Log log;
@In
Identity identity;
@In
EntityManager entityManager;
private User user = new User();
public boolean authenticate() {
log.info("authenticating #0", identity.getUsername());
// write your authentication logic here,
// return true if the authentication was
// successful, false otherwise
try {
user = (User) entityManager
.createQuery(
"from User where username = :username and password = :password")
.setParameter("username", identity.getUsername())
.setParameter("password", identity.getPassword())
.getSingleResult();
if (user.getUserRoles() != null) {
for (UserRole role : user.getUserRoles()) {
identity.addRole(role.getRole().getName());
}
}
return true;
} catch (NoResultException ex) {
return false;
}
}
@Out
public User getUser() {
return user;
}
}
i login to the home page ,then drop the menu update,the url is manhour/UserEdit.seam?cid=37
but the edit page has no the user info,but when i drop the menu update again,the url is manhour/UserEdit.seam?userId=1&cid=38,here the user info appear,i can't understant that.
can you help me?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4078602#4078602
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4078602
More information about the jboss-user
mailing list