bean « Request « JSP-Servlet Q&A





1. Inject Request beans into a servlet fails    seamframework.org

@SessionScoped public class SessionContext implements Serializable { @Inject private Logger log; private static final long serialVersionUID = 1L; private Account account; private User user; public void userAuthenticated(@Observes @LoggedIn User user) { this.user = null; log.infov("User swapped to : {0}", user.getUsername()); this.user = user; this.account = user.getAccount(); } public void userLoggedOut(@Observes @LoggedOut User user) { this.user = null; } @Produces @LoggedIn public ...

2. keep bean for only a few requests, not a whole session    coderanch.com

What's the best way to create and use a bean for just one or two or three request and response cycles instead of keeping it in memory as long as the session is alive? I've never used a simple JavaBean whose life is set to the request--only ones that remain for the whole session. Is there a way to have it ...

4. jsp:setProperty/Bean equivalent for request.getParameterValues    coderanch.com

Hello all, I want to pass multiple parameters with the same name and store those parameters in a bean as a string array, using jsp:useBean and jsp:setProperty where property="*". What does the setter block inside the bean look like? Is the input parameter a string array, and jsp:setProperty is smart enough to see all the request parameters with the same name ...

6. making my bean accesible to 3rd JSP using request scope    coderanch.com

guys I have a real problem. I have a form where I accept the values and call another JSP which populates the bean with the data like: I then call another JSP where I display the data entered to confirm if user wants to insert into the dbase, from there I call another ...