I don't know if I understand your question but would making the input
attribute of the action another action give you the opportunity to retrieve
data that the jsp form needs before the jsp is displayed? I have a form that
needs a drop down populated from the database before the form is displayed.
I can never go to the jsp form directly, I always reference the action that
gets the data needed by the jsp. The action returns a forward which forwards
to the jsp with redirect="false". 

Hal

-----Original Message-----
From: Ned Seagoon [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 20, 2001 6:06 PM
To: [EMAIL PROTECTED]
Subject: Re: help! confused over forms and errors and oooh, other stuff
:-)



Can nobody give me a clue as to whether I've missed something here? I have
to do a 'show and tell' session on friday where we probably will be deciding
whether to use struts as the basis of future developments. If I'm going to
have to branch away from struts to handle these issues, so be it, but I'd
rather hope they were handled somewhere. Worst case scenario is that we
don't use struts at all.

Regards
Ned

----- Original Message -----
From: "Ned Seagoon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 20, 2001 11:47 AM
Subject: help! confused over forms and errors and oooh, other stuff :-)


> Hi Guys,
>
> I wonder if you could help me out a little please? I am in the middle of
> developing a proof of concept app with struts. If this comes off the
company
> could migrate away from a proprietary framework to struts, which I am in
> favour of.
>
> I seem to have confused myself over an issue regarding validation and
forms.
> I’ll give a simplified workflow as an example.
>
> We have for all intents and purposes a generated product overview page
along
> these lines:
>
> *Wooden Throat Mallet        59.95 >buy<
> *Leather Uncle Frightener    12.60 >buy<
> *Vandal-Proof Toupee         99.99 >buy<
>
> Which is generated from struts tags. The >buys< are links to a pages which
> look something like ‘buyit.do?itemid=50’. The buyit.do action has
registered
> a form in request scope. During processing, it looks up the full details
of
> the itemid and places the resulting bean in request scope. It then creates
> the form object, populates it with some default information and sets this
in
> the request too before forwarding onto buypage.jsp
>
> This displays the details of the item, and contains a form for entering,
> say, credit card details:
>
> *Item: Vandal-Proof Toupee
> *Manufacturer: Lockheed-Martin Advanced Hairpiece Research
> *Price: 99.99
> *Additional Information: Also Invisible to Radar
> *
> * Inside Leg Measurement: _____
> * Credit Card Number: ____________________
> * >BUY< {forwards onto checkout.do}
>
> Which is all fine and dandy and displays correctly. Though what happens if
> the form validate fails? If checkout.do has an ‘input’ attribute which is
> buypage.jsp then this will fail because the item details are stored on the
> request has not been set up (it was done in ‘buyit.do’). I could of course
> set the item details on the session, but if the user opened new browser
> windows for the ‘buyit’ link, then the session level object will be
> overwritten.
>
> If have looked into placing the details object onto the form bean as it is
> populated, but will that property be preserved across a validate failing?
> And how do I get at the properties of the form bean outside of the
> <hmtl:xxx> tags?
>
> Help !
>
> Regards
> Ned
>
>
>
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
>

Reply via email to