Hi,
I am doing something like the following on a page:
<jsp:useBean id="mybean" scope="session" calss="com.bm.ui.beans.MyBean" />
<form method="post">
<%
for( int cntr = 0; cntr < mybean.getList().size(); cntr++ )
{
%>
<table>
<tr>
<td>
name:
</td>
<td>
<input type="text" name="name" value="<%= mybean.getName() %>">
</td>
</tr>
<tr>
<td>
address:
</td>
<td>
<input type="text" name="address" value="<%= mybean.getAddress() %>">
</td>
</tr>
</table>
<%
}
%>
</form>
Now..what I am hoping to do is use the <jsp:setProperty name="mybean"
property="*" /> so that it automatically fills in the beans properties with
the input tags. However, what I am having a question on is since I might be
displaying 2 or more "records" on the screen, and each of those has the
SAME input tags with the same names, how will the bean populate the fields,
then submit the form correctly. Do I have to use the request.getParameter()
in my bean and iterate over the list? Do I maybe have to give the names
like: <input name="firstName_0"..name="firstName_1" etc? How can you submit
a single form that allows a bean to read in ALL the listed records and
handle them correctly. Each record will have a deny/reject drop down that
is selected by one of our admin folks. Each record displayed can be
rejected or denied, and when the submit button at the very bottom is
clicked, I want to iterate through ALL the items and as each record is read
in fully, then figure out if it was selected to be rejected or denied.
I hope this makes sense. I am not sure how to go about this with
JSP/JavaBeans. Our current site just does the request.getParameter() but we
are switching to JSP/JavaBean and I want to take advantage of anything I
can that makes it easier to maintain.
Thank you.
Kevin Duffey
Software Engineer
[EMAIL PROTECTED]
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html