Re: session form bean reuse

2002-12-02 Thread Mark Lepkowski
How do you get session A information available to session B without persisting it 
somehow (the HttpSessionContext interface is depracated in Java Servlet API v2.1for 
security reasons...)?
  Struts will not itself reuse form bean instances across sessions (although
  your application could copy one if it really wanted to).




Re: session form bean reuse

2002-12-02 Thread Craig R. McClanahan


On Mon, 2 Dec 2002, Mark Lepkowski wrote:

 Date: Mon, 02 Dec 2002 09:21:42 -0500
 From: Mark Lepkowski [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Subject: Re: session form bean reuse

 How do you get session A information available to session B without persisting it 
somehow (the HttpSessionContext interface is depracated in Java Servlet API v2.1for 
security reasons...)?
   Struts will not itself reuse form bean instances across sessions (although
   your application could copy one if it really wanted to).



Use servlet context attributes to share information between all the
sessions in your webapp.

Craig



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: session form bean reuse

2002-12-02 Thread Mark Lepkowski
  How do you get session A information available to session B without persisting it 
somehow (the HttpSessionContext interface is depracated in Java Servlet API v2.1for 
security reasons...)?
(snip)
 
 
 Use servlet context attributes to share information between all the
 sessions in your webapp.

Thanks for the info.  I knew there had to be something in the servlet scope, but 
didn't know quite where to find it.  The following works in any of our classes that 
extend Action:

servlet.getServletContext().setAttribute( myAttribute, myAttribute );

and likewise

MyAttribute myAttribute = (MyAttribute)servlet.getServletContext().getAttribute( 
myAttribute );

I noticed that:
- servlet is declared a protected transient ActionServlet in ActionServletWrapper, 
- ActionForm has the getter method for the wrapper,
- RequestUtils.populate() calls the getter,
- ActionServlet calls RequestUtils.populate()

What I don't follow is how the servlet object is exposed in the Action subclasses.



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: session form bean reuse

2002-12-01 Thread Craig R. McClanahan


On Fri, 29 Nov 2002, Sven Frederik Pohl wrote:

 Date: Fri, 29 Nov 2002 15:10:41 +0100
 From: Sven Frederik Pohl [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Subject: session form bean reuse

 Hello all,

 I got a simple question, but I could not find any answer on the net:
 Could a session scope form bean get reused by another session if the session ends?
 Or is it garanteed, that a session scope form bean instance is only used by a 
*single* session?


Struts will not itself reuse form bean instances across sessions (although
your application could copy one if it really wanted to).

 Thanks in advance,

 Sven Pohl

Craig


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




session form bean reuse

2002-11-29 Thread Sven Frederik Pohl
Hello all,

I got a simple question, but I could not find any answer on the net:
Could a session scope form bean get reused by another session if the session ends?
Or is it garanteed, that a session scope form bean instance is only used by a *single* 
session?

Thanks in advance,

Sven Pohl
[EMAIL PROTECTED]
[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: session form bean reuse

2002-11-29 Thread Gemes Tibor
2002. november 29. 15:10 dátummal Sven Frederik Pohl ezt írtad:
 Could a session scope form bean get reused by another session if the
 session ends? 

No

 Or is it garanteed, that a session scope form bean instance
 is only used by a *single* session?

Yes.

Tib

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]