You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "White, Joshua A (CASD, IT)" <Jo...@thehartford.com> on 2003/03/13 12:13:09 UTC

When does the servlet reference in the ActionForm get set?

I have been trying unsuccessfully to get a reference to the ServletContext
from my BaseForm class which extends ActionForm.  I have attempted to get a
reference to the ActionServlet by calling the inherited "getServlet" method
as well as referencing the inherited "servlet" field.  Both are returning
null.  

When does this reference get set?  Should I not be receiving null?

Joshua 








-----Original Message-----
From: White, Joshua A (CASD, IT) 
Sent: Wednesday, March 12, 2003 6:41 PM
To: 'Sri Sankaran'; Struts Users Mailing List
Subject: RE: servlet reference in form bean in null?


I was actually talking about the "servlet" member variable of the ActionForm
class.  Is there any difference if I reference the "servlet" variable or the
getServlet method?  The servlet member variable is null.  I have not dug up
the source yet, but I would imagine the getServlet method returns the local
copy of the servlet field.  Both are "protected".  Both are null when I use
them.

Any ideas?

Joshua



-----Original Message-----
From: Sri Sankaran [mailto:Sri.Sankaran@sas.com]
Sent: Wednesday, March 12, 2003 4:28 PM
To: Struts Users Mailing List
Subject: RE: servlet reference in form bean in null?


I think he means the getServlet() method of ActionForm.

Sri

-----Original Message-----
From: Mark Galbreath [mailto:mark_galbreath@qat.com] 
Sent: Wednesday, March 12, 2003 4:26 PM
To: 'Struts Users Mailing List'
Subject: RE: servlet reference in form bean in null?


Might have if you posted the code to which you are referring.

Mark

-----Original Message-----
From: White, Joshua A (CASD, IT) [mailto:Joshua.White@thehartford.com] 
Sent: Wednesday, March 12, 2003 4:16 PM
To: struts-user@jakarta.apache.org
Subject: servlet reference in form bean in null?


Hello all,

I am having trouble determining why the "servlet" reference in my formbean
is null.  I have created a class "BaseForm" which extends ActionForm.  Any
ideas?  

Joshua


This communication, including attachments, is for the exclusive use of 
addressee and may contain proprietary, confidential or privileged 
information. If you are not the intended recipient, any use, copying, 
disclosure, dissemination or distribution is strictly prohibited. If 
you are not the intended recipient, please notify the sender 
immediately by return email and delete this communication and destroy all
copies.


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org