tags:

views:

42

answers:

1

Using Seam 2.1.2 and JSF 1.2 I wonder how to store the users login name in the database.

In plain JSF I would simply lookup FacesContext.getCurrentInstance().getExternalContext().getRemoteUser();in a backing bean and set the value into a persistent object.

How can I achieve that the users name will be stored in the DB?

+1  A: 

You can inject a Credentials component

private @In Credentials credentials;

So retrieve your logged user by using

credentials.getUsername();
Arthur Ronald F D Garcia