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]