Jared;
*** You can have your JSP display it's contents dynamically. For this you can use map or list backed forms. But keep in mind that you need to populate such maps or lists before you can display in your JSP.
*** Your action form is available in your action class. Look at one of the the parameters passed to execute(...) method in your action class. You need to downcast to exact form type though. The contents of the form is available in your action class's execute method. But keep in mind that following sequence happen exactly in that sequence:
1. call reset method in your action form if you have overridden it.
2. populate your action form fields with matching HttpServletRequest attributes.
3. call validate method if overridden.
After this, execute mthod returns which is the last point that you can manipulate your data. So in action form's execute method you can see the data populated based on your form submitted. Once execute returns, struts takes control and forwards to the appropriate page.


So, you need to populate your form before you can display the text boxes with the JSP. But keep in mind that the form fields name match with the request atrtribute name, then you can manipulate if action class ify you want. If the names does not match, you will not the data your form has posted.

Let me know if you still have confusion.

Sharad Acharya




From: Jared Blitzstein <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: map-backed forms example
Date: Fri, 27 Feb 2004 15:51:29 -0800 (PST)

I've been searching the archive and google or an
example of a map-backed form similar to what i'm
trying to accomplish, but I haven't found anything.
What i'm trying to do is this:

somePage.jsp has a dynamic number textboxes on it,
some i know the exact name of ("color") and some I
just know what they start with ("attribute_1",
"attribute_2"...etc). It submits to ProcessMyData.do
which does some back end processing on those form
elements, then forwards to another JSP. I can't seem
to access the data from the form in the action.

All the examples I have found go directly to a JSP for
display, nothing in the action. Can anyone show me an
example (form, action, config.xml) of how to pass in a
few textboxes, get that data in an action, and then
forward (last step not that important).

Thanks alot.
If you need any more info or anything else from me,
let me know.

__________________________________
Do you Yahoo!?
Get better spam protection with Yahoo! Mail.
http://antispam.yahoo.com/tools

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


_________________________________________________________________
Store more e-mails with MSN Hotmail Extra Storage – 4 plans to choose from! http://click.atdmt.com/AVE/go/onm00200362ave/direct/01/



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to