Hello,

we want to accomplish the following:
We want ao make JSP pages to represent several lists with different lenths.
Each JSP page will be a form that looks the same way:

Item1: _______
Item2: _______
...
ItemN: _______

That is, you have a list of items representing the list, each one has an 
associated text field to enter the data.
If JSP had more flexibility we could do that with ONE JSP and ONE JavaBean:

We would have a loop to create a form which each text field having data 
through:
<jsp:getProperty name="testBean" property="info"/>

That's the way it works now. What I do, is that for the first call to 
getInfo I return the first element for the list, and so on...

The problem is with the setInfo method.

My form posts the data to the test.jsp
<FORM name="menu" method="post" action="test.jsp" 
ENCODE="application/x-www-form-urlencoded">

Which in turn sets the properties of the testBean.
<jsp:setProperty name="testBean" property="*"/>

I wanted to make the same with the setInfo method. The first setting should 
apply to the first list element, the second to the second, and so on. But 
it doesn't work unfortunately. It seems that the "setInfo" method is only 
called once, even if the form has several fields with the name "info".

What I really would need is a way for the setter and getter methods to an 
additional parameter, something like

setInfo(1,"Bla");
setInfo(2,"jflad");

getInfo(1);
getInfo(2);

This way I could implement what I want.
The way it is now it doesn't work, but I have to create a JSP and a Bean 
for every list, instead of having just one for all the lists.
And I have to create a set and get method for every element of the list. 
Boring.
Is there a way out of it? Maybe using a pure servlet approach without JSP? 
Or any other related tecnology?
Any help would be appreciated,

Roland





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

Reply via email to