[Opensource] How to retrieve session variables in ActionForm object

Wise, Malcolm Malcolm.Wise at eu.sony.com
Fri Jul 4 13:28:47 PDT 2003


Vinod,

There are two basic ways to achieve this.  Either obtain the Collection
containing the data for the <html:options> from the session in the Struts
Action class (or Expresso Controller), and populate a Collection variable on
the ActionForm associated with the Action class.  If you are using struts
<html:form> tags then the jsp that you forward to can access the field from
the ActionForm in the <html:options> tag.  Alternatively, you can  access
the session variable in the jsp directly in the <html:options> tag.
For details on the various methods you can use, go to
http://jakarta.apache.org/struts/userGuide/struts-html.html#options

HTH,
Malc

-----Original Message-----
From: vinod.nayak at iflexsolutions.com
[mailto:vinod.nayak at iflexsolutions.com]
Sent: 04 July 2003 13:19
To: opensource at jcorporate.com
Subject: [Opensource] How to retrieve session variables in ActionForm
object


How to get objects stored in session object in objects extended from
ActionForm class [ in struts framework].

I need to build a <html:options> list in a jsp page, which has a
corresponding ActionForm object
and within that object I need to access some object already stored in
session object.

As per my knowledge we do not have access to Request or Session object
within ActionForm object.

Please help me.

Regards,
Vinod


DISCLAIMER:
This message contains privileged and confidential information and is
intended only for the individual named.If you are not the intended recipient
you should not disseminate,distribute,store,print, copy or deliver this
message.Please notify the sender immediately by e-mail if you have received
this e-mail by mistake and delete this e-mail from your system.E-mail
transmission cannot be guaranteed to be secure or error-free as information
could be intercepted,corrupted,lost,destroyed,arrive late or incomplete or
contain viruses.The sender therefore does not accept liability for any
errors or omissions in the contents of this message which arise as a result
of e-mail transmission. If verification is required please request a
hard-copy version.
_______________________________________________
Opensource mailing list
Opensource at jcorporate.com
http://mail.jcorporate.com/mailman/listinfo/opensource
Archives: http://mail.jcorporate.com/pipermail/opensource/


*************************************************************************
The information contained in this message or any of its
attachments may be privileged and confidential and intended 
for the exclusive use of the addressee. If you are not the
addressee any disclosure, reproduction, distribution or other
dissemination or use of this communication is strictly prohibited
*************************************************************************



More information about the Opensource mailing list