HI,
I'm having the same problem (and saw this posting right after I've put mine in).
Yes, getting the ActionServlet let's me access the ServletContext, but then I'm even
further away from getting the request that caused the ActionForm to be created, or do
I see this wrong?
Well, I guess, that I could do something like: having always a different ActionMapping
"in front"
of the one, where the ActionForm will be created. Within this pre-executed Action I
use the same Form
(and have access to the request), change the Form according to the request and forward
it to the
real Action (just the first idea I had).
But isn't there a way of accessing the request somhow directly from within the
constructor of the Form?
Holger
-----Ursprungliche Nachricht-----
Von: Rajan Gupta [mailto:[EMAIL PROTECTED]]
Gesendet: Mittwoch, 18. Juli 2001 16:13
An: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Betreff: Re: getSession in xxxForm
You have access to ActionServlet as a protected attribute in ActionForm.
do a getServletContext() on the instance & you are on your way
--- Stefan Faist <[EMAIL PROTECTED]> wrote:
> Hello All,
> I have set an attribute into a session: "session.setAttribute("id",
> xxxForm.getId());"
> Now I want to get this attribute in a xxxForm:
> "session.getAttribute("id");". But I have no HttpRequest object.
>
> How can I get the session in the xxxForm?
> Can someone help me?
>
> Stefan
> ----------------------------------------------
> hmi-Informatik GmbH
> Zettachring 6 - D-70567 Stuttgart
> E-Mail: [EMAIL PROTECTED]
> http://www.hmi-informatik.de
>
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/