Firstly I'd ask what is wrong with using session scope - has load testing your applcation shown that session scope is too memory intensive?
It looks like the 'years' list was stored in the form bean. You will need to recreate all of your lists etc (e.g. years) in every action if you are going to move to request scope (or take 'years' out of the form and put it in a session scoped attribute). Paul > -----Original Message----- > From: Janice [mailto:[EMAIL PROTECTED] > Sent: 24 February 2004 20:01 > To: [EMAIL PROTECTED] > Subject: need help converting from session to request scope > > > Hi Gang, > > I've been doing things badly... putting everything in session > scope. The > good news is that everything works beautifully :) But now > that I've got > 100+ actions I've decided to go put stuff into request scope. > The bad news > is that everything grinds to a halt. > > Here's an example of where I've added the scope to an action mapping: > <--- snip ---> > <action path="/yearlyAllocation" > input=".yearlyAllocationForm" > parameter="action" > > type="ca.bc.gov.srm.bart.actions.YearlyAllocationActions" > scope="request" > name="yearlyAllocationForm" > validate="false"> > <forward name="form" path=".yearlyAllocationForm" /> > <forward name="list" path=".yearlyAllocationList" /> > <forward name="gotolist" > path="/yearlyAllocation.do?action=showList" > /> > </action> > </--- snip ---> > Previously I'd left the scope line out. > > So my now jsp page can't find my form goodies on the page. > It falls apart > here: > <--- snip ---> > <html:select property="yearCode"> > <html:optionsCollection property="years" label="yearFull" > value="yearCode" /> > </html:select> > </--- snip ---> > with a NullPointerException. But it did make it past here: > <--- snip ---> > <html:form action="/yearlyAllocation?action=submitForm" > name="yearlyAllocationForm" > type="org.apache.struts.validator.DynaValidatorForm" > focus="yearCode"> > </--- snip ---> > which I guess I'm surprised at. > > I'd love to put up all kinds of code, but I'm using > DispatchActions, tiles, > DynaValidatorForms, etc, so I'm not really sure where to > start cutting and > pasting. If anyone has any requests for more info, I'd be > happy to oblige. > > Oh, this one looks important: in my method where I set up the > form before > passing it to the .jsp, I set up my form all pretty with lots > of Strings and > ArrayLists and then I do one of these: > <--- snip ---> > if ( "request".equals(mapping.getScope()) ) { > request.setAttribute(mapping.getAttribute(), form); > } else { > HttpSession session = request.getSession(); > session.setAttribute(mapping.getAttribute(), form); > } > </--- snip ---> > which I thought was designed to handle this. > > So, to make a long story short, what else do I need to do to > switch from > putting all my form beans in session scope to putting them in > request scope? > Do I need to tell the .jsp page to look somewhere else or something? > > Thanks very much in advance, > Janice > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > ************************************** Axios Email Confidentiality Footer Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. If you or your employer does not consent to Internet email messages of this kind, please advise us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my Company or employer unless otherwise indicated by an authorised representative independent of this message. WARNING: While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via electronic mail attachments we cannot guarantee that attachments do not contain computer virus code. You are therefore strongly advised to undertake anti virus checks prior to accessing the attachment to this electronic mail. Axios Systems Ltd grants no warranties regarding performance use or quality of any attachment and undertakes no liability for loss or damage howsoever caused. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

