Hi,
i have a little problem.
I store an entity existingUser in my session-Context when a request page is
called with the username as request parameter.
| @Stateless
| @Name("userBox")
| @Scope(org.jboss.seam.ScopeType.SESSION)
| @Interceptors(SeamInterceptor.class)
| public class UserBoxAction implements UserBox {
| private static final Logger log = Logger.getLogger(UserBoxAction.class);
|
| @Out
| private User existingUser;
|
| @In
| private transient Context sessionContext;
|
| @RequestParameter("username")
| private String username;
|
| @PersistenceContext
| private EntityManager em;
|
|
| @Factory("existingUser")
| public void listUserDetails() {
| //if the user comes from the guestbook back and does not start
a request
| if (username.equals("")||username==null)
| {
| username = existingUser.getUsername();
| }
| log.info("existingUser will be injected" + username);
| existingUser = (User) em.createQuery(
| "from User where username=:username").setParameter("username",
| username).getSingleResult();
| //set the selected User in the Session, because nothing else
will work
| // properly
| sessionContext.set("existingUser", existingUser);
| }
| }
|
But when i call this page twice in the same session with another username, the
factory isn't working. That's right, because the existingUser entity is known
in the context now. But that's not what i want. How can i invoke the factory on
every request and override the existingUser entity?
Thanx in advance.
Udo
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3939992#3939992
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3939992
-------------------------------------------------------
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