I really don't know if this is the way I should handle this :
I have an application, where I want that people to be allowed to log in
simultanously with differents rights/password, idealy with differents
sessions. But the problem is that all these sessions should live in
parallel, without interference. To be perfectly clear, where talking of a
single application, which should not be splited.
The ejb of each session are the same, except that they do not contain the
same datas.
As long as (correct me if I'm wrong) it is not possible to dynamically
choose which bean is used by the jsp:useBean tag, the only workaround I
could figure is to store the session beans with a name identifying the
session, for example
s1_resultBean
s1_accessBean
s2_resultBean
...
In the other hand, in the jsp, I must use a single name (did I precise that
the jsp pages are the sames in all session ?)
<jsp:useBean class... scope="session" id="resultBean">
So what I planed was to copy the s1_resultBean in a request scope resultBean
in the application servlet, an then the jsp useBean would refer to
<jsp:useBean class... scope="request" id="resultBean">
But I'm not really sure what would happen with my Bean after the request is
served :
- will the s1_resultBean content be destroyed, as request's resultBean
should be
- is the s1_resultBean duplicated when I do a request.setAttribute
("resultBean", session.getValue ("s1_resultBean")), which means that the two
objects will live their own lives, and that one sould be destroyed without
touching the other
- is it the same instance of the object in the two scopes, which will be
destroyed in the most lasting scope's destruction (ie the request object is
lost, but as the real object also resides in the session scope, it continues
its life)
Of course, the 3 solutions are in inverse order of my likehood ;-)
Is there any other way to handle that, or do you think this could work for
production ?
Regards
Sylvain
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets