There is no way to approach this problem as you currently are. You should be 
able to achieve the same effect however, but you will need to restructure 
your approach. Not knowing the details of you situation I would advise you to 
think in terms of having an action initialize your action form and set it as 
a request (or session...) attribute. 

Good Luck,

Troy

On Tuesday 07 August 2001 07:16 am, you wrote:
> Thanks for the response but I was talking about the ActionForm not the
> Action - perhaps I wasn't clear in my earlier post.  The reason I am asking
> is that I would like to prepare some data for a jsp within an ActionForms
> constructor and have the jsp display this data via reflection of the
> ActionForms elements.  I would like to be able to grab a value from the
> session within the ActionForms constructor but can't figure out how to
> access it as there doesn't seem to be any means of doing so.
>
> Anyone have any thoughts?
>
> Simon.
>
> -----Original Message-----
> From: Jon Crater [mailto:[EMAIL PROTECTED]]
> Sent: 07 August 2001 13:47
> To: [EMAIL PROTECTED]
> Subject: Re: session question
>
>
> the action form's perform method receives a HttpServletRequest object,
> which
>
> has a getSession() method.  call it to get access to the current session.
> note that getAttribute(String key) returns Object, so a typecast would
> probably be required.
>
> public ActionForward perform(ActionMapping mapping, ActionForm form,
> HttpServletRequest request, HttpServletResponse response)
> {
>    HttpSession session = request.getSession();
>    YourObject o = (YourObject)session.getAttribute("yourSessionKey");
>    //do something with the object
> }
>
>
> ----Original Message Follows----
> From: "Prior, Simon" <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
> Subject: session question
> Date: Tue, 7 Aug 2001 13:33:31 +0100
>
> Hi all,
>
> Does anybody know whether it is possible to access elements on the session
> from the action form? - outside of the methods reset and validae?
>
> Thanks,
>
> Simon.
> For optimum solutions that save you time, visit www.ds-s.com.
>
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
> For optimum solutions that save you time, visit www.ds-s.com.

Reply via email to