Is there any limit with session management in your application server? I mean, Websphere, for example, warns you about storing more than 16K in session.
To bypass this problem, there is a good alternative (to the best of my knowledge): create a Map where keys would be session IDs and values would be data (this would lead to the need of creating a wrapper for all your data). Then, this Map could be placed in application context, servlet context (in case of Struts which only uses one ActionServlet) or even as a static Map shared by all users in the application server (of course, with no clustering at all).
I would be delighted to hear some comments and suggestions in this solution.
Enrique Medina.
From: "Frank Zammetti" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: RE: Single ActionForm accross multiple Actions
Date: Tue, 08 Jun 2004 22:02:01 -0400
MIME-Version: 1.0
X-Originating-IP: [68.81.51.228]
X-Originating-Email: [EMAIL PROTECTED]
X-Sender: [EMAIL PROTECTED]
Received: from mail.apache.org ([209.237.227.199]) by mc3-f6.hotmail.com with Microsoft SMTPSVC(5.0.2195.6824); Tue, 8 Jun 2004 19:02:13 -0700
Received: (qmail 97286 invoked by uid 500); 9 Jun 2004 02:02:37 -0000
Received: (qmail 97272 invoked by uid 99); 9 Jun 2004 02:02:36 -0000
Received: from [64.4.27.85] (HELO hotmail.com) (64.4.27.85) by apache.org (qpsmtpd/0.27.1) with ESMTP; Tue, 08 Jun 2004 19:02:36 -0700
Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 8 Jun 2004 19:02:01 -0700
Received: from 68.81.51.228 by by8fd.bay8.hotmail.msn.com with HTTP;Wed, 09 Jun 2004 02:02:01 GMT
X-Message-Info: JGTYoYF78jEng6W3tuLSY7svF94DHMWf
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:[EMAIL PROTECTED]>
List-Subscribe: <mailto:[EMAIL PROTECTED]>
List-Help: <mailto:[EMAIL PROTECTED]>
List-Post: <mailto:[EMAIL PROTECTED]>
List-Id: "Struts Users Mailing List" <user.struts.apache.org>
Delivered-To: mailing list [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
X-OriginalArrivalTime: 09 Jun 2004 02:02:01.0481 (UTC) FILETIME=[C0FB5790:01C44DC5]
X-Virus-Checked: Checked
Return-Path: [EMAIL PROTECTED]
You can set the scope attribute of your action mappings to session, then you don't have to do the code you have below. The form instance that is passed into execute() will either be what was in session, or a newly created one.
I'm not sure about the answer to the second part of your question, but I'm about 99.99% sure you can still use it (anyone else verify?)
Frank
From: "Kunal H. Parikh" <[EMAIL PROTECTED]> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]> Subject: RE: Single ActionForm accross multiple Actions Date: Wed, 9 Jun 2004 10:34:27 +1000
Great ...... thanks for all the responses...
I think I will go with the ActionForm stored in session-scope.
Just wanting to confirm, that I will need to perform the following code changes:
================== public ActionForward execute( ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse ) throws Exception { actionForm = httpServletRequest.getSession().getAttribute("myForm"); // ... // normal code follows!!! } ==================
Also, would I be correct in saying that I will be unable to use the ValidatorActionForm.
TIA,
Kunal
-----Original Message----- From: Frank Zammetti [mailto:[EMAIL PROTECTED] Sent: Tuesday, 8 June 2004 23:21 To: [EMAIL PROTECTED] Subject: RE: Single ActionForm accross multiple Actions
This is more or less what a session-scope ActionForm is for. As long as the
ActionForm class contains all the properties and methods for all the screen
it will service, just putting it in session I think is your best bet. As
someone else said, hidden form fields are your other choice. Actually, you
could also store the data temporarily to a database, but if you would even
consider that, session is really the right answer.
Frank
>From: "Kunal H. Parikh" <[EMAIL PROTECTED]> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]> >To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]> >Subject: Single ActionForm accross multiple Actions >Date: Tue, 8 Jun 2004 12:08:25 +1000 > >Hi All! > >I want to maintain a single ActionForm across multiple Actions. > >I want to get the info from the user in a step-by-step manner, but only >wanna talk to the SessionBean at the end when they hit "confirm". > >The alternative that I can think of is writing a JavaBean with all the >properties, and pass the JavaBean around as a session attribute. > >Any one have a better solution ? > > >TIA, > >Kunal > > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >
_________________________________________________________________
Watch the online reality show Mixed Messages with a friend and enter to win
a trip to NY
http://www.msnmessenger-download.click-url.com/go/onm00200497ave/direct/01/
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar – get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
_________________________________________________________________
Reserva desde ahora tus vacaciones en MSN Viajes. Más cómodo, más barato y más opciones. http://www.msn.es/Viajes/
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]