RE: dynamic parameters

2004-02-10 Thread Villalba Arias, Fredy [BILBOMATICA]
Hi,

I don't know about indexes, but I can think of a simple solution, Struts-independent 
(well, not 100%): have all values concatenated in a single hidden attribute that 
get's submitted, using different tokens for separating different values and for 
separating different records (by record I mean a set of values). Then it's just about 
parsing it (the value stored on the corresponding property) on the server side. I know 
It's not the most elegant solution, but it you are short of time, then it will 
surely do it.

HTH,
Freddy.

-Mensaje original-
De: Nathan Maves [mailto:[EMAIL PROTECTED] 
Enviado el: martes, 10 de febrero de 2004 1:24
Para: Struts Users Mailing List
Asunto: dynamic parameters

I have searched but found nothing on this specific example.

I have a form that will have n number of elements.  Each of these 
elements will needs it own name.

example.

list of students is displayed on the screen with two text fields for 
their first and last name.

This is for a mass update page.

The only way I can thing of is to have form element like..

text name=#student_id#-#first_name#
text name=#student_id#-#last_name#

This way in my action I can parse out the student id and then update 
the corresponding first and last name.

Can this be done or is there a better way to do it.


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


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.459 / Virus Database: 258 - Release Date: 25/02/2003
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.459 / Virus Database: 258 - Release Date: 25/02/2003
 

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



Re: dynamic parameters

2004-02-10 Thread Nathan Maves
First thanks for your time trying to help me.

Here is the deal

I have a list of elements.

NameId
Student A   123
Student B 123
Student C 123
Student D 123
Student E 123
Student F 123
and I only have data (first  last name) for some random amount of 
them.  On these rows I want the form to create text fields for these 
items.

Student A
Student B   joe schmoe
Student C
Student D   joe schmoe
Student E   joe schmoe
Student F   
Since the index from the outside foreach will not work for the 
indexed properties first and last name I believe that I will have to 
test if the current student row is equal to the next row in the array 
of data.  If they are then I will have to create the html:text  by 
hand.

Nathan Maves
Sun Microsystems
On Feb 10, 2004, at 1:40 AM, Villalba Arias, Fredy [BILBOMATICA] wrote:

Hi,

I don't know about indexes, but I can think of a simple solution, 
Struts-independent (well, not 100%): have all values concatenated in a 
single hidden attribute that get's submitted, using different tokens 
for separating different values and for separating different records 
(by record I mean a set of values). Then it's just about parsing it 
(the value stored on the corresponding property) on the server side. I 
know It's not the most elegant solution, but it you are short of 
time, then it will surely do it.

HTH,
Freddy.
-Mensaje original-
De: Nathan Maves [mailto:[EMAIL PROTECTED]
Enviado el: martes, 10 de febrero de 2004 1:24
Para: Struts Users Mailing List
Asunto: dynamic parameters
I have searched but found nothing on this specific example.

I have a form that will have n number of elements.  Each of these
elements will needs it own name.
example.

list of students is displayed on the screen with two text fields for
their first and last name.
This is for a mass update page.

The only way I can thing of is to have form element like..

text name=#student_id#-#first_name#
text name=#student_id#-#last_name#
This way in my action I can parse out the student id and then update
the corresponding first and last name.
Can this be done or is there a better way to do it.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.459 / Virus Database: 258 - Release Date: 25/02/2003
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.459 / Virus Database: 258 - Release Date: 25/02/2003
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

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

Re: dynamic parameters

2004-02-10 Thread Michael McGrady
Hi, Nathan:

This is progress, but I cannot tell what Since the index from the outside 
foreach will not work for the indexed properties first and last name 
means.  Please clarify.

So far I can tell only the following: you have a list of students 
identified only by first and last name.  You want to have a form that gets 
some more information, i.e. a third bit of information, from them via a 
text field.

There are various reasons why what you are writing is hard to read.  Your 
examples indicate a reality which is unlikely to be true, e.g. you have all 
the students with the same name such a Joe Schmoe.  You apparently are 
using A, B, etc. to stand in for what you call a NameId.  If that is true 
or not is impossible to tell.

Let me try to understand what you want to do.  Do you merely want to update 
student names when you have them stored under student ids?  I really cannot 
tell what you want to do.  Whatever you want to do can easily be done, I am 
sure.  It is really hard to tell what you want done.  If you are trying to 
update names alone, then how are you doing this.  Are the students doing 
it?  Is an administrator doing it?  Is the problem that there are too many 
students for one page?  Is the problem that you don't have them indexed by 
name?  If they are indexed by id, and there are a known number, you an 
create a Map with the students and use the id as an indexed property to 
retrieve the students.  But, again, your explanation is not readable for 
me.  So, I don't know what you want to do.  Want to try again?

Michael

Michael

At 07:52 AM 2/10/2004, you wrote:
First thanks for your time trying to help me.

Here is the deal

I have a list of elements.

NameId
Student A   123
Student B 123
Student C 123
Student D 123
Student E 123
Student F 123
and I only have data (first  last name) for some random amount of 
them.  On these rows I want the form to create text fields for these items.

Student A
Student B   joe schmoe
Student C
Student D   joe schmoe
Student E   joe schmoe
Student F
Since the index from the outside foreach will not work for the indexed 
properties first and last name I believe that I will have to test if the 
current student row is equal to the next row in the array of data.  If 
they are then I will have to create the html:text  by hand.

Nathan Maves
Sun Microsystems


On Feb 10, 2004, at 1:40 AM, Villalba Arias, Fredy [BILBOMATICA] wrote:

Hi,

I don't know about indexes, but I can think of a simple solution, 
Struts-independent (well, not 100%): have all values concatenated in a 
single hidden attribute that get's submitted, using different tokens 
for separating different values and for separating different records (by 
record I mean a set of values). Then it's just about parsing it (the 
value stored on the corresponding property) on the server side. I know 
It's not the most elegant solution, but it you are short of time, then 
it will surely do it.

HTH,
Freddy.
-Mensaje original-
De: Nathan Maves [mailto:[EMAIL PROTECTED]
Enviado el: martes, 10 de febrero de 2004 1:24
Para: Struts Users Mailing List
Asunto: dynamic parameters
I have searched but found nothing on this specific example.

I have a form that will have n number of elements.  Each of these
elements will needs it own name.
example.

list of students is displayed on the screen with two text fields for
their first and last name.
This is for a mass update page.

The only way I can thing of is to have form element like..

text name=#student_id#-#first_name#
text name=#student_id#-#last_name#
This way in my action I can parse out the student id and then update
the corresponding first and last name.
Can this be done or is there a better way to do it.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.459 / Virus Database: 258 - Release Date: 25/02/2003
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.459 / Virus Database: 258 - Release Date: 25/02/2003
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


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


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


Re: dynamic parameters

2004-02-10 Thread Nathan Maves
Sorry for an ambiguity that was in my example.

here are the gory details :)

I am only using student as an example the real object would only 
complicate matters.

In an action I am retrieving :

- a list of all the students objects. This includes their student id.

- an array of studentsGrade objects.  These objects have a studentId, 
semester1Grade, semester2Grade in them.  Remember that there might be, 
at most, the same amount of studentGrade objects as there are students. 
 It is the case where there are less that I am concerned in.

In the jsp :

 I only what the form to create text fields for the student if there 
was data found.  This may seem strange but there is a good business 
reason for this.

I need the full list of students to be displayed in the page.  With out 
this everything works great.  The list of students is also ordered.

Last ditch effort,
Nathan
On Feb 10, 2004, at 11:43 AM, Michael McGrady wrote:

Hi, Nathan:

This is progress, but I cannot tell what Since the index from the 
outside foreach will not work for the indexed properties first and 
last name means.  Please clarify.

So far I can tell only the following: you have a list of students 
identified only by first and last name.  You want to have a form that 
gets some more information, i.e. a third bit of information, from them 
via a text field.

There are various reasons why what you are writing is hard to read.  
Your examples indicate a reality which is unlikely to be true, e.g. 
you have all the students with the same name such a Joe Schmoe.  You 
apparently are using A, B, etc. to stand in for what you call a 
NameId.  If that is true or not is impossible to tell.

Let me try to understand what you want to do.  Do you merely want to 
update student names when you have them stored under student ids?  I 
really cannot tell what you want to do.  Whatever you want to do can 
easily be done, I am sure.  It is really hard to tell what you want 
done.  If you are trying to update names alone, then how are you doing 
this.  Are the students doing it?  Is an administrator doing it?  Is 
the problem that there are too many students for one page?  Is the 
problem that you don't have them indexed by name?  If they are indexed 
by id, and there are a known number, you an create a Map with the 
students and use the id as an indexed property to retrieve the 
students.  But, again, your explanation is not readable for me.  So, I 
don't know what you want to do.  Want to try again?

Michael

Michael

At 07:52 AM 2/10/2004, you wrote:
First thanks for your time trying to help me.

Here is the deal

I have a list of elements.

NameId
Student A   123
Student B 123
Student C 123
Student D 123
Student E 123
Student F 123
and I only have data (first  last name) for some random amount of 
them.  On these rows I want the form to create text fields for these 
items.

Student A
Student B   joe schmoe
Student C
Student D   joe schmoe
Student E   joe schmoe
Student F
Since the index from the outside foreach will not work for the 
indexed properties first and last name I believe that I will have to 
test if the current student row is equal to the next row in the array 
of data.  If they are then I will have to create the html:text  by 
hand.

Nathan Maves
Sun Microsystems


On Feb 10, 2004, at 1:40 AM, Villalba Arias, Fredy [BILBOMATICA] 
wrote:

Hi,

I don't know about indexes, but I can think of a simple solution, 
Struts-independent (well, not 100%): have all values concatenated in 
a single hidden attribute that get's submitted, using different 
tokens for separating different values and for separating different 
records (by record I mean a set of values). Then it's just about 
parsing it (the value stored on the corresponding property) on the 
server side. I know It's not the most elegant solution, but it you 
are short of time, then it will surely do it.

HTH,
Freddy.
-Mensaje original-
De: Nathan Maves [mailto:[EMAIL PROTECTED]
Enviado el: martes, 10 de febrero de 2004 1:24
Para: Struts Users Mailing List
Asunto: dynamic parameters
I have searched but found nothing on this specific example.

I have a form that will have n number of elements.  Each of these
elements will needs it own name.
example.

list of students is displayed on the screen with two text fields for
their first and last name.
This is for a mass update page.

The only way I can thing of is to have form element like..

text name=#student_id#-#first_name#
text name=#student_id#-#last_name#
This way in my action I can parse out the student id and then update
the corresponding first and last name.
Can this be done or is there a better way to do it.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com

RE: dynamic parameters

2004-02-10 Thread Samyukta Akunuru
So is there so way to retrieve the form value seletcions in form of some array or so 
to be passed to the form

Thanks.

-Original Message-
From: Nathan Maves [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 10, 2004 1:35 PM
To: Struts Users Mailing List
Subject: Re: dynamic parameters


Sorry for an ambiguity that was in my example.

here are the gory details :)

I am only using student as an example the real object would only 
complicate matters.

In an action I am retrieving :

- a list of all the students objects. This includes their student id.

- an array of studentsGrade objects.  These objects have a studentId, 
semester1Grade, semester2Grade in them.  Remember that there might be, 
at most, the same amount of studentGrade objects as there are students. 
  It is the case where there are less that I am concerned in.

In the jsp :

  I only what the form to create text fields for the student if there 
was data found.  This may seem strange but there is a good business 
reason for this.

I need the full list of students to be displayed in the page.  With out 
this everything works great.  The list of students is also ordered.

Last ditch effort,
Nathan

On Feb 10, 2004, at 11:43 AM, Michael McGrady wrote:

 Hi, Nathan:

 This is progress, but I cannot tell what Since the index from the 
 outside foreach will not work for the indexed properties first and 
 last name means.  Please clarify.

 So far I can tell only the following: you have a list of students 
 identified only by first and last name.  You want to have a form that 
 gets some more information, i.e. a third bit of information, from them 
 via a text field.

 There are various reasons why what you are writing is hard to read.  
 Your examples indicate a reality which is unlikely to be true, e.g. 
 you have all the students with the same name such a Joe Schmoe.  You 
 apparently are using A, B, etc. to stand in for what you call a 
 NameId.  If that is true or not is impossible to tell.

 Let me try to understand what you want to do.  Do you merely want to 
 update student names when you have them stored under student ids?  I 
 really cannot tell what you want to do.  Whatever you want to do can 
 easily be done, I am sure.  It is really hard to tell what you want 
 done.  If you are trying to update names alone, then how are you doing 
 this.  Are the students doing it?  Is an administrator doing it?  Is 
 the problem that there are too many students for one page?  Is the 
 problem that you don't have them indexed by name?  If they are indexed 
 by id, and there are a known number, you an create a Map with the 
 students and use the id as an indexed property to retrieve the 
 students.  But, again, your explanation is not readable for me.  So, I 
 don't know what you want to do.  Want to try again?

 Michael

 Michael

 At 07:52 AM 2/10/2004, you wrote:
 First thanks for your time trying to help me.

 Here is the deal

 I have a list of elements.

 NameId
 Student A   123
 Student B 123
 Student C 123
 Student D 123
 Student E 123
 Student F 123

 and I only have data (first  last name) for some random amount of 
 them.  On these rows I want the form to create text fields for these 
 items.

 Student A
 Student B   joe schmoe
 Student C
 Student D   joe schmoe
 Student E   joe schmoe
 Student F

 Since the index from the outside foreach will not work for the 
 indexed properties first and last name I believe that I will have to 
 test if the current student row is equal to the next row in the array 
 of data.  If they are then I will have to create the html:text  by 
 hand.

 Nathan Maves
 Sun Microsystems




 On Feb 10, 2004, at 1:40 AM, Villalba Arias, Fredy [BILBOMATICA] 
 wrote:

 Hi,

 I don't know about indexes, but I can think of a simple solution, 
 Struts-independent (well, not 100%): have all values concatenated in 
 a single hidden attribute that get's submitted, using different 
 tokens for separating different values and for separating different 
 records (by record I mean a set of values). Then it's just about 
 parsing it (the value stored on the corresponding property) on the 
 server side. I know It's not the most elegant solution, but it you 
 are short of time, then it will surely do it.

 HTH,
 Freddy.

 -Mensaje original-
 De: Nathan Maves [mailto:[EMAIL PROTECTED]
 Enviado el: martes, 10 de febrero de 2004 1:24
 Para: Struts Users Mailing List
 Asunto: dynamic parameters

 I have searched but found nothing on this specific example.

 I have a form that will have n number of elements.  Each of these
 elements will needs it own name.

 example.

 list of students is displayed on the screen with two text fields for
 their first and last name.

 This is for a mass update page.

 The only way I can thing of is to have form element like..

 text name=#student_id#-#first_name#
 text name=#student_id#-#last_name#

 This way in my action I can

Re: dynamic parameters

2004-02-10 Thread Matt Bathje
Nathan - I think in a situation like this I would put an if test into the
loop. If there is no data for the student, I would make HIDDEN form fields
for that student, otherwise I would make the text fields. Then in your
action, if the fields are blank, you don't need to worry about updating
them. (Although then you need to think about what happens if a users enters
blanks into the text fields - maybe add another field to each student for
whether the user was allowed to input data or something like that)


Matt Bathje


- Original Message - 
From: Nathan Maves [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Tuesday, February 10, 2004 1:35 PM
Subject: Re: dynamic parameters


 Sorry for an ambiguity that was in my example.

 here are the gory details :)

 I am only using student as an example the real object would only
 complicate matters.

 In an action I am retrieving :

 - a list of all the students objects. This includes their student id.

 - an array of studentsGrade objects.  These objects have a studentId,
 semester1Grade, semester2Grade in them.  Remember that there might be,
 at most, the same amount of studentGrade objects as there are students.
   It is the case where there are less that I am concerned in.

 In the jsp :

   I only what the form to create text fields for the student if there
 was data found.  This may seem strange but there is a good business
 reason for this.

 I need the full list of students to be displayed in the page.  With out
 this everything works great.  The list of students is also ordered.

 Last ditch effort,
 Nathan

 On Feb 10, 2004, at 11:43 AM, Michael McGrady wrote:

  Hi, Nathan:
 
  This is progress, but I cannot tell what Since the index from the
  outside foreach will not work for the indexed properties first and
  last name means.  Please clarify.
 
  So far I can tell only the following: you have a list of students
  identified only by first and last name.  You want to have a form that
  gets some more information, i.e. a third bit of information, from them
  via a text field.
 
  There are various reasons why what you are writing is hard to read.
  Your examples indicate a reality which is unlikely to be true, e.g.
  you have all the students with the same name such a Joe Schmoe.  You
  apparently are using A, B, etc. to stand in for what you call a
  NameId.  If that is true or not is impossible to tell.
 
  Let me try to understand what you want to do.  Do you merely want to
  update student names when you have them stored under student ids?  I
  really cannot tell what you want to do.  Whatever you want to do can
  easily be done, I am sure.  It is really hard to tell what you want
  done.  If you are trying to update names alone, then how are you doing
  this.  Are the students doing it?  Is an administrator doing it?  Is
  the problem that there are too many students for one page?  Is the
  problem that you don't have them indexed by name?  If they are indexed
  by id, and there are a known number, you an create a Map with the
  students and use the id as an indexed property to retrieve the
  students.  But, again, your explanation is not readable for me.  So, I
  don't know what you want to do.  Want to try again?
 
  Michael
 
  Michael
 
  At 07:52 AM 2/10/2004, you wrote:
  First thanks for your time trying to help me.
 
  Here is the deal
 
  I have a list of elements.
 
  NameId
  Student A   123
  Student B 123
  Student C 123
  Student D 123
  Student E 123
  Student F 123
 
  and I only have data (first  last name) for some random amount of
  them.  On these rows I want the form to create text fields for these
  items.
 
  Student A
  Student B   joe schmoe
  Student C
  Student D   joe schmoe
  Student E   joe schmoe
  Student F
 
  Since the index from the outside foreach will not work for the
  indexed properties first and last name I believe that I will have to
  test if the current student row is equal to the next row in the array
  of data.  If they are then I will have to create the html:text  by
  hand.
 
  Nathan Maves
  Sun Microsystems
 
 
 
 
  On Feb 10, 2004, at 1:40 AM, Villalba Arias, Fredy [BILBOMATICA]
  wrote:
 
  Hi,
 
  I don't know about indexes, but I can think of a simple solution,
  Struts-independent (well, not 100%): have all values concatenated in
  a single hidden attribute that get's submitted, using different
  tokens for separating different values and for separating different
  records (by record I mean a set of values). Then it's just about
  parsing it (the value stored on the corresponding property) on the
  server side. I know It's not the most elegant solution, but it you
  are short of time, then it will surely do it.
 
  HTH,
  Freddy.
 
  -Mensaje original-
  De: Nathan Maves [mailto:[EMAIL PROTECTED]
  Enviado el: martes, 10 de febrero de 2004 1:24
  Para: Struts Users Mailing List
  Asunto: dynamic

Re: dynamic parameters

2004-02-10 Thread Michael McGrady
 Users Mailing List
Asunto: dynamic parameters
I have searched but found nothing on this specific example.

I have a form that will have n number of elements.  Each of these
elements will needs it own name.
example.

list of students is displayed on the screen with two text fields for
their first and last name.
This is for a mass update page.

The only way I can thing of is to have form element like..

text name=#student_id#-#first_name#
text name=#student_id#-#last_name#
This way in my action I can parse out the student id and then update
the corresponding first and last name.
Can this be done or is there a better way to do it.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.459 / Virus Database: 258 - Release Date: 25/02/2003
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.459 / Virus Database: 258 - Release Date: 25/02/2003
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


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


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


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



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


dynamic parameters

2004-02-09 Thread Nathan Maves
I have searched but found nothing on this specific example.

I have a form that will have n number of elements.  Each of these 
elements will needs it own name.

example.

list of students is displayed on the screen with two text fields for 
their first and last name.

This is for a mass update page.

The only way I can thing of is to have form element like..

text name=#student_id#-#first_name#
text name=#student_id#-#last_name#
This way in my action I can parse out the student id and then update 
the corresponding first and last name.

Can this be done or is there a better way to do it.

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


Re: dynamic parameters

2004-02-09 Thread Matt Bathje
What you want are called indexed properties in struts.

Start here: http://jakarta.apache.org/struts/faqs/indexedprops.html
and here:  http://www.developer.com/java/ejb/article.php/2233591

Then search the list archives for any specific questions you have, many have
been answered.

Also, if you are having n number of elements, make sure your form goes into
the session scope instead of the request scope. This is probably the biggest
issue with indexed properties I have seen.

Matt Bathje


- Original Message - 
From: Nathan Maves [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Monday, February 09, 2004 6:24 PM
Subject: dynamic parameters


 I have searched but found nothing on this specific example.

 I have a form that will have n number of elements.  Each of these
 elements will needs it own name.

 example.

 list of students is displayed on the screen with two text fields for
 their first and last name.

 This is for a mass update page.

 The only way I can thing of is to have form element like..

 text name=#student_id#-#first_name#
 text name=#student_id#-#last_name#

 This way in my action I can parse out the student id and then update
 the corresponding first and last name.

 Can this be done or is there a better way to do it.


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



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



RE: dynamic parameters

2004-02-09 Thread Ram Prasadh
u can possibly create a custom class that has firstname and last name.. say something 
like
class Student {
private String firstName;
private String lastName;
... getFirstName() ...
... setFirstName(String firstName)
... getLastName() ...
... setLastName(String lastName) ...
}

student[0].firstName
student[0].lastName

student[1].firstName
student[1].lastName
...
student[n].firstName
student[n].lastName

as names in your form...

in the ActionForm u can have something like

setStudent(Student[] students) {...}
setStuden(int index, Student student) {...}
getStudent(int index) {...}
getStuden() {...}

Hope this helps ... :)

-Original Message-
From: Nathan Maves [mailto:[EMAIL PROTECTED]
Sent: Monday, February 09, 2004 4:24 PM
To: Struts Users Mailing List
Subject: dynamic parameters


I have searched but found nothing on this specific example.

I have a form that will have n number of elements.  Each of these 
elements will needs it own name.

example.

list of students is displayed on the screen with two text fields for 
their first and last name.

This is for a mass update page.

The only way I can thing of is to have form element like..

text name=#student_id#-#first_name#
text name=#student_id#-#last_name#

This way in my action I can parse out the student id and then update 
the corresponding first and last name.

Can this be done or is there a better way to do it.


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


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



Re: dynamic parameters

2004-02-09 Thread Nathan Maves
Perfect... The second link was great.  Now lets dive a little deeper 
with my problem.

I assume that for form pre-population I will have to set the array 
value in the form before it gets to the jsp.

Say I have a list of students that could be larger then the array of 
the up-datable fields.

I loop though all of the students but only n number of them will have 
data in the array from the form.  Is this possible?

I hope I explained this well if not I can call anyone who is willing to 
listen :)

Nathan

On Feb 9, 2004, at 5:32 PM, Matt Bathje wrote:

What you want are called indexed properties in struts.

Start here: http://jakarta.apache.org/struts/faqs/indexedprops.html
and here:  http://www.developer.com/java/ejb/article.php/2233591
Then search the list archives for any specific questions you have, 
many have
been answered.

Also, if you are having n number of elements, make sure your form goes 
into
the session scope instead of the request scope. This is probably the 
biggest
issue with indexed properties I have seen.

Matt Bathje

- Original Message -
From: Nathan Maves [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Monday, February 09, 2004 6:24 PM
Subject: dynamic parameters

I have searched but found nothing on this specific example.

I have a form that will have n number of elements.  Each of these
elements will needs it own name.
example.

list of students is displayed on the screen with two text fields for
their first and last name.
This is for a mass update page.

The only way I can thing of is to have form element like..

text name=#student_id#-#first_name#
text name=#student_id#-#last_name#
This way in my action I can parse out the student id and then update
the corresponding first and last name.
Can this be done or is there a better way to do it.

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


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


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


Re: dynamic parameters

2004-02-09 Thread Michael McGrady
Nathan, this looks like you are just having people do your coding.  This is 
not a struts question.  This is just a coding question.  Anyway, the answer 
to your question is that of course that is possible.  Why wouldn't it be 
possible?  All you have to do is to stop at n.

At 05:11 PM 2/9/2004, you wrote:
Perfect... The second link was great.  Now lets dive a little deeper with 
my problem.

I assume that for form pre-population I will have to set the array value 
in the form before it gets to the jsp.

Say I have a list of students that could be larger then the array of the 
up-datable fields.

I loop though all of the students but only n number of them will have data 
in the array from the form.  Is this possible?

I hope I explained this well if not I can call anyone who is willing to 
listen :)

Nathan

On Feb 9, 2004, at 5:32 PM, Matt Bathje wrote:

What you want are called indexed properties in struts.

Start here: http://jakarta.apache.org/struts/faqs/indexedprops.html
and here:  http://www.developer.com/java/ejb/article.php/2233591
Then search the list archives for any specific questions you have, many have
been answered.
Also, if you are having n number of elements, make sure your form goes into
the session scope instead of the request scope. This is probably the biggest
issue with indexed properties I have seen.
Matt Bathje

- Original Message -
From: Nathan Maves [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Monday, February 09, 2004 6:24 PM
Subject: dynamic parameters

I have searched but found nothing on this specific example.

I have a form that will have n number of elements.  Each of these
elements will needs it own name.
example.

list of students is displayed on the screen with two text fields for
their first and last name.
This is for a mass update page.

The only way I can thing of is to have form element like..

text name=#student_id#-#first_name#
text name=#student_id#-#last_name#
This way in my action I can parse out the student id and then update
the corresponding first and last name.
Can this be done or is there a better way to do it.

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


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


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



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


dynamic parameters to DynaActionForm

2004-01-08 Thread Nathan Maves
is it possible to have dynamic parameters sent to to a dyna form?

I do not know how many or the name of the parameters that are being 
sent?

Nathan

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


RE: dynamic parameters to DynaActionForm

2004-01-08 Thread Robert Taylor
Look at IndexedProperties:
http://jakarta.apache.org/struts/faqs/indexedprops.html

robert

 -Original Message-
 From: Nathan Maves [mailto:[EMAIL PROTECTED]
 Sent: Thursday, January 08, 2004 1:02 PM
 To: Struts Users Mailing List
 Subject: dynamic parameters to DynaActionForm
 
 
 is it possible to have dynamic parameters sent to to a dyna form?
 
 I do not know how many or the name of the parameters that are being 
 sent?
 
 Nathan
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

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



Re: dynamic parameters to DynaActionForm

2004-01-08 Thread Nathan Maves
Robert,

I have been researching all morning and still can not find a good 
answer.

I need to send the action a set of parameters like..

param1
param2
param3
.
.
.
param#
The amount of parameters in the form are dynamic.  How or what type of 
object would you use in a form bean.

Nathan

On Jan 8, 2004, at 11:18 AM, Robert Taylor wrote:

Look at IndexedProperties:
http://jakarta.apache.org/struts/faqs/indexedprops.html
robert

-Original Message-
From: Nathan Maves [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 08, 2004 1:02 PM
To: Struts Users Mailing List
Subject: dynamic parameters to DynaActionForm
is it possible to have dynamic parameters sent to to a dyna form?

I do not know how many or the name of the parameters that are being
sent?
Nathan

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


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


RE: dynamic parameters to DynaActionForm

2004-01-08 Thread Yee, Richard K,,DMDCWEST
Nathan,
Try a map backed form 
http://www.mail-archive.com/[EMAIL PROTECTED]/msg88704.html

-Richard


-Original Message-
From: Nathan Maves [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 08, 2004 12:13 PM
To: Struts Users Mailing List
Subject: Re: dynamic parameters to DynaActionForm


Robert,

I have been researching all morning and still can not find a good 
answer.

I need to send the action a set of parameters like..

param1
param2
param3
.
.
.
param#

The amount of parameters in the form are dynamic.  How or what type of 
object would you use in a form bean.

Nathan


On Jan 8, 2004, at 11:18 AM, Robert Taylor wrote:

 Look at IndexedProperties: 
 http://jakarta.apache.org/struts/faqs/indexedprops.html

 robert

 -Original Message-
 From: Nathan Maves [mailto:[EMAIL PROTECTED]
 Sent: Thursday, January 08, 2004 1:02 PM
 To: Struts Users Mailing List
 Subject: dynamic parameters to DynaActionForm


 is it possible to have dynamic parameters sent to to a dyna form?

 I do not know how many or the name of the parameters that are being 
 sent?

 Nathan


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


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



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

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



RE: dynamic parameters to DynaActionForm

2004-01-08 Thread Robert Taylor
Nathan, could you explain in a little more detail:


Is is a use case where you retrieve a value from somewhere
which tells you how many empty fields to generate and this value
could vary. Then these empty fields are populated with user input
and sent to the server to update the database.

If so, you could do the following:

I would also use org.apache.commons.collections.ListUtils.lazyList()
implementation.
http://jakarta.apache.org/commons/collections/api/org/apache/commons/collect
ions/ListUtils.html#lazyList(java.util.List,%20org.apache.commons.collection
s.Factory)


The lazyList implementation will create a new object using the
specified Factory when Struts indexes into a position in the list
which is null.

form-bean name=myForm
 type=com.company.MyForm
   form-property name=colors
  type=java.util.List/

/form-bean

Subclass your DynaActionForm and override the reset()

public final class MyForm extends DynaActionForm {

private static Logger logger = Logger
.getLogger(SearchContractsForm.class.getName());

/**
 * Reset all bean properties to their default state.  This method is
 * called before the properties are repopulated by the controller
servlet.
 * p
 * The default implementation uses the initial value specified in the
 * FormPropertyConfig element for each property.
 *
 * @param mapping The mapping used to select this instance
 * @param request The servlet request we are processing
 */
public void reset(ActionMapping mapping, HttpServletRequest request) {

   super.reset(mapping, request);

   List colors = ListUtils.lazyList(new ArrayList(), new
StringFactory());
   this.set(colors, colors);


}

/**
 * codeStringFactory/code
 *
 * @see org.apache.commons.ListUtils
 */
class StringFactory implements Factory {

/**
 * Create a new instance of the specified object
 */
public Object create() {

return new String();

}


}

}

Define an action which is invoked prior to displaying the jsp.
In the action populate the colors data member with a List of
empty Strings.

In the page do one of the following:

One way to display the values is like so:

c:forEach var=color items${myForm.colors} varStatus=status
c:set var=property value=colors[${status.index}]/
html_el:text property=${property}/
/c:forEach


Another way would be to leverage the Struts tags:
logic:iterate id=color name=myForm property=colors
html:text name=colors property=color indexed=true/
/logic:iterate


Either way should render html like:

input type=text name=colors[0] value=/
input type=text name=colors[1] value=/
input type=text name=colors[2] value=/
input type=text name=colors[3] value=/
input type=text name=colors[4] value=/
 ...
input type=text name=colors[n] value=/


Upon submitting the form, Struts will invoke reset() and
populate the colors data member with a new lazy list.

When Struts indexes into an empty location, lazy list will
first create a new String at that location and then
Struts will populate that with the value sent from the client.


That should give you a better idea of how to use indexed properties.

hth,

robert

 -Original Message-
 From: Nathan Maves [mailto:[EMAIL PROTECTED]
 Sent: Thursday, January 08, 2004 3:13 PM
 To: Struts Users Mailing List
 Subject: Re: dynamic parameters to DynaActionForm


 Robert,

 I have been researching all morning and still can not find a good
 answer.

 I need to send the action a set of parameters like..

 param1
 param2
 param3
 .
 .
 .
 param#

 The amount of parameters in the form are dynamic.  How or what type of
 object would you use in a form bean.

 Nathan


 On Jan 8, 2004, at 11:18 AM, Robert Taylor wrote:

  Look at IndexedProperties:
  http://jakarta.apache.org/struts/faqs/indexedprops.html
 
  robert
 
  -Original Message-
  From: Nathan Maves [mailto:[EMAIL PROTECTED]
  Sent: Thursday, January 08, 2004 1:02 PM
  To: Struts Users Mailing List
  Subject: dynamic parameters to DynaActionForm
 
 
  is it possible to have dynamic parameters sent to to a dyna form?
 
  I do not know how many or the name of the parameters that are being
  sent?
 
  Nathan
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 


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



-
To unsubscribe, e-mail: [EMAIL PROTECTED

html:link with several dynamic parameters

2002-11-04 Thread Marcus Biel
Hi,
I'v got a link that uses dynamic and static parameters at the same time.
html:link page=/Action.do?sort=id paramName=myForm
paramId=mySelection paramProperty=mySelectionID/html:link
Now I need more then one dynamic parameter. How can I add it ?
Do I just need to repeat paramName=myForm paramId=mySecondSelection
?
If so, how to seperate the 2 dynamic parameters ? 


thx in advance,


marcus

--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




Re: html:link with several dynamic parameters

2002-11-04 Thread Kris Schneider
Marcus,

Depending on which version of Struts you're using, check out:

http://jakarta.apache.org/struts/doc-1.0.2/struts-html.html#link

or

http://jakarta.apache.org/struts/userGuide/struts-html.html#link

Specifically, note that you can provide a Map that contains all of the request 
parameters for the link.

Quoting Marcus Biel:

 Hi,
 I'v got a link that uses dynamic and static parameters at the same time.
 html:link page=/Action.do?sort=id paramName=myForm
 paramId=mySelection paramProperty=mySelectionID/html:link
 Now I need more then one dynamic parameter. How can I add it ?
 Do I just need to repeat paramName=myForm paramId=mySecondSelection
 ?
 If so, how to seperate the 2 dynamic parameters ? 
 
 
 thx in advance,
 
 
 marcus

-- 
Kris Schneider mailto:kris;dotech.com
D.O.Tech   http://www.dotech.com/

--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




Re: html:link with several dynamic parameters

2002-11-04 Thread Marcus Biel
Of course I already had a look at this page,
but I need several dynamic parameters, and about that nothing is told.

About the map:

I don't know how to exactly use it, plus I doubt I could use it, as the
parameters I need are in different forms.

marcus

[EMAIL PROTECTED] schrieb:
 
 Marcus,
 
 Depending on which version of Struts you're using, check out:
 
 http://jakarta.apache.org/struts/doc-1.0.2/struts-html.html#link
 
 or
 
 http://jakarta.apache.org/struts/userGuide/struts-html.html#link
 
 Specifically, note that you can provide a Map that contains all of the request
 parameters for the link.

--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




Re: html:link with several dynamic parameters

2002-11-04 Thread Kris Schneider
Maybe I'm missing the intent of what you're trying to do, but the entire point 
of the Map is to contain several dynamic parameters. The html:link tag uses 
each Map key as the name of a request parameter and the associated Map value as 
the String or String array parameter value(s). I can't think of how you could 
get much more dynamic.

To pull data out of a number of different forms, they'll have to have been 
populated and stored in session scope prior to the request that results in the 
JSP with your html:link tag. The easiest thing to do would be to have an Action 
collect the data from the forms, create and populate the Map, store it as a 
request attribute and then forward to the JSP.

Quoting Marcus Biel [EMAIL PROTECTED]:

 Of course I already had a look at this page,
 but I need several dynamic parameters, and about that nothing is told.
 
 About the map:
 
 I don't know how to exactly use it, plus I doubt I could use it, as the
 parameters I need are in different forms.
 
 marcus
 
 [EMAIL PROTECTED] schrieb:
  
  Marcus,
  
  Depending on which version of Struts you're using, check out:
  
  http://jakarta.apache.org/struts/doc-1.0.2/struts-html.html#link
  
  or
  
  http://jakarta.apache.org/struts/userGuide/struts-html.html#link
  
  Specifically, note that you can provide a Map that contains all of the
 request
  parameters for the link.
 
 --
 To unsubscribe, e-mail:  
 mailto:struts-user-unsubscribe;jakarta.apache.org
 For additional commands, e-mail:
 mailto:struts-user-help;jakarta.apache.org
 
 


-- 
Kris Schneider mailto:kris;dotech.com
D.O.Tech   http://www.dotech.com/

--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




Re: html:link with several dynamic parameters

2002-11-04 Thread David Graham
You need to use the Map feature to include more than one parameter.  I 
suggest using the JSTL's c:url tag instead.  That tag is standard and 
handles multiple parameters much better than html:link

David






From: Marcus Biel [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: html:link with several dynamic parameters
Date: Mon, 04 Nov 2002 09:35:30 +0100

Hi,
I'v got a link that uses dynamic and static parameters at the same time.
html:link page=/Action.do?sort=id paramName=myForm
paramId=mySelection paramProperty=mySelectionID/html:link
Now I need more then one dynamic parameter. How can I add it ?
Do I just need to repeat paramName=myForm paramId=mySecondSelection
?
If so, how to seperate the 2 dynamic parameters ?


thx in advance,


marcus

--
To unsubscribe, e-mail:   
mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: 
mailto:struts-user-help;jakarta.apache.org


_
Get a speedy connection with MSN Broadband.  Join now! 
http://resourcecenter.msn.com/access/plans/freeactivation.asp


--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org



RE: html:link with several dynamic parameters

2002-11-04 Thread Sri Sankaran
You *should* be able to use the Map approach.  Simply build a map whose keys are the 
expected parameter names and the corresponding values are the data you wish to send.  
For example:

html:link forward=foo property=paramsClick Me!/html:link

In your form bean, the getter getParams() returns a Map such as:

public Map getParams() {
  Map map = new Map();
  map.put(a, apple);
  map.put(b, boy);
  map.put(c, cat);
  return map;
}

The action that is called will receive: ?a=appleb=boyc=cat

Sri

-Original Message-
From: Marcus Biel [mailto:Marcus.Biel;bmw.de] 
Sent: Monday, November 04, 2002 9:00 AM
To: [EMAIL PROTECTED]
Subject: Re: html:link with several dynamic parameters


Of course I already had a look at this page,
but I need several dynamic parameters, and about that nothing is told.

About the map:

I don't know how to exactly use it, plus I doubt I could use it, as the parameters I 
need are in different forms.

marcus

[EMAIL PROTECTED] schrieb:
 
 Marcus,
 
 Depending on which version of Struts you're using, check out:
 
 http://jakarta.apache.org/struts/doc-1.0.2/struts-html.html#link
 
 or
 
 http://jakarta.apache.org/struts/userGuide/struts-html.html#link
 
 Specifically, note that you can provide a Map that contains all of the 
 request parameters for the link.

--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org


--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




Re: html:link with several dynamic parameters

2002-11-04 Thread Kris Schneider
Just a note that html:link provides some Struts-specific features that may 
make you think twice before converting to JSTL's c:url:

Ability to specify a global ActionForward.

Transactional control token support.

Works with a JSP 1.1 container (okay, so that's not Struts-specific).

I'm also curious why you'd say that c:param tags are much better than a Map 
for handling multiple patameters.

Quoting David Graham [EMAIL PROTECTED]:

 You need to use the Map feature to include more than one parameter.  I 
 suggest using the JSTL's c:url tag instead.  That tag is standard and 
 handles multiple parameters much better than html:link
 
 David

-- 
Kris Schneider mailto:kris;dotech.com
D.O.Tech   http://www.dotech.com/

--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




Re: html:link with several dynamic parameters

2002-11-04 Thread David Graham
Yes, the ability to specify an ActionForward is nice but not enough to make 
me use html:link.  The c:param tags are better than using a map because 
you don't have to write scriptlet code to initialize the map (you could 
init. the map in other places but it's still a pain).  It's more efficient 
and clearer to specify individual param elements.

David


From: Kris Schneider [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Re: html:link with several dynamic parameters
Date: Mon,  4 Nov 2002 10:14:47 -0500

Just a note that html:link provides some Struts-specific features that 
may
make you think twice before converting to JSTL's c:url:

Ability to specify a global ActionForward.

Transactional control token support.

Works with a JSP 1.1 container (okay, so that's not Struts-specific).

I'm also curious why you'd say that c:param tags are much better than a 
Map
for handling multiple patameters.

Quoting David Graham [EMAIL PROTECTED]:

 You need to use the Map feature to include more than one parameter.  I
 suggest using the JSTL's c:url tag instead.  That tag is standard and
 handles multiple parameters much better than html:link

 David

--
Kris Schneider mailto:kris;dotech.com
D.O.Tech   http://www.dotech.com/

--
To unsubscribe, e-mail:   
mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: 
mailto:struts-user-help;jakarta.apache.org


_
Get faster connections -- switch to MSN Internet Access! 
http://resourcecenter.msn.com/access/plans/default.asp


--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org



Re: html:link with several dynamic parameters

2002-11-04 Thread Kris Schneider
Of course, you can always combine approaches:

jsp:useBean id=paramMap class=java.util.HashMap/
c:set target=${paramMap} property=p1 value=v1/
c:set target=${paramMap} property=p2 value=v2/
html:link forward=foo name=paramMap/

But in reality, I'd be more likely to create and populate the Map in an Action 
that fronts the JSP. The Map would either end up as a scoped attribute or as a 
property on an ActionForm or some other bean. I don't consider that much of a 
pain and there's certainly no scriptlet code.

One other thing to consider about Map vs. c:param tags is direct support for 
multi-valued parameters. You can dump a String[] into a Map value and 
html:link will use it to produce a request parameter (whose name is the Map 
key) for each array element. You'd have to use multiple c:param tags with the 
same name attribute to accomplish something similar. I'd love to see c:param 
incorporate that functionality, maybe I'll submit an RFE...

Quoting David Graham [EMAIL PROTECTED]:

 Yes, the ability to specify an ActionForward is nice but not enough to make
 
 me use html:link.  The c:param tags are better than using a map because
 
 you don't have to write scriptlet code to initialize the map (you could 
 init. the map in other places but it's still a pain).  It's more efficient 
 and clearer to specify individual param elements.
 
 David
 
 
 From: Kris Schneider [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Subject: Re: html:link with several dynamic parameters
 Date: Mon,  4 Nov 2002 10:14:47 -0500
 
 Just a note that html:link provides some Struts-specific features that 
 may
 make you think twice before converting to JSTL's c:url:
 
 Ability to specify a global ActionForward.
 
 Transactional control token support.
 
 Works with a JSP 1.1 container (okay, so that's not Struts-specific).
 
 I'm also curious why you'd say that c:param tags are much better than a 
 Map
 for handling multiple patameters.
 
 Quoting David Graham [EMAIL PROTECTED]:
 
   You need to use the Map feature to include more than one parameter.  I
   suggest using the JSTL's c:url tag instead.  That tag is standard and
   handles multiple parameters much better than html:link
  
   David
 
 --
 Kris Schneider mailto:kris;dotech.com
 D.O.Tech   http://www.dotech.com/
 
 --
 To unsubscribe, e-mail:   
 mailto:struts-user-unsubscribe;jakarta.apache.org
 For additional commands, e-mail: 
 mailto:struts-user-help;jakarta.apache.org
 
 
 _
 Get faster connections -- switch to MSN Internet Access! 
 http://resourcecenter.msn.com/access/plans/default.asp
 
 
 --
 To unsubscribe, e-mail:  
 mailto:struts-user-unsubscribe;jakarta.apache.org
 For additional commands, e-mail:
 mailto:struts-user-help;jakarta.apache.org

-- 
Kris Schneider mailto:kris;dotech.com
D.O.Tech   http://www.dotech.com/

--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




URGENT!!! Dynamic parameters in App Resources for error handling

2002-08-31 Thread Tarun Sainanee

Hi all,
I have been pretty happy using struts 1.0.2 for some time now. But now i 
have a problem. Please help.

I know that we can user parameterized messages in the App Resources file 
for error messages. Depending on the no of parameters i can have an 
errors.add() method pass the parameters.
But the problem is that i do not know in advance how many parameters i may 
need to pass? Any workaround guys?

Also is there a way that i can access the message in App Resources File 
and modify it at runtime???

Pointers to a working code would be excellent.


Regards,
Tarun Sainanee
TCS Delhi
--
Finance is the art of passing money from hand to hand until it finally 
disappears.
-- Robert W. Sarnoff



RE: [MessageResources] URGENT!!! Dynamic parameters in App Resources for error handling

2002-08-31 Thread James Mitchell

 -Original Message-
 From: Tarun Sainanee [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, August 31, 2002 11:05 AM

 Hi all,
 I have been pretty happy using struts 1.0.2 for some time now. But now i
 have a problem. Please help.

 I know that we can use parameterized messages in the App Resources file
 for error messages. Depending on the no of parameters i can have an
 errors.add() method pass the parameters.
 But the problem is that i do not know in advance how many
 parameters i may
 need to pass? Any workaround guys?

Instead of using getMessage(key, arg0, arg1, etc, etc

use getMessage(key, args[])



 Also is there a way that i can access the message in App Resources File
 and modify it at runtime???

my-best-guess
The default implementation of MessageResources (PropertyMessageResources)
does not provide for any way to manipulate the underlying HashMap at
runtime.

However, I guess you could hack around this with your own implementation
(not recommended).  Myself and a few others are looking at creating a
JDBCMessageResources that will probably provide a reload method.  So, I
guess, in a way that would allow someone to modify at runtime.
/my-best-guess


 Pointers to a working code would be excellent.


 Regards,
 Tarun Sainanee
 TCS Delhi


Hope that helps

James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the Open Minded Developer Network
http://www.open-tools.org/struts-atlanta


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




using link with multiple dynamic parameters

2001-10-01 Thread Anna Englund

Hi,

my problem is as follows:
I would like to use the html:link tag with multiple
dynamic parameters. I've tried to use the a
java.util.Map, but it seems to handle only fixed
values. Please, correct me if I'm wrong. 

In the example I'm iterating through a company list. I
create two links for each company in the list. The
first retrieves sets the company id in the companyID
parameter. The second creates a link with the company
name in the companyName parameter. Now, the question,
how do I  create a link with both parameters in the
same link? I would like to create a link as below for
each company in the list:
/company.do?flow=viewcompanyID=6companyName=test
table
 logic:iterate name=companyList id=company
  tr
   td
html:link forward=viewCompany
paramID=companyID paramName=company
paramProperty=ID 
bean:write name=company
property=name//html:link
   /td
   td
html:link forward=viewCompany
paramID=companyName paramName=company
paramProperty=name 
bean:write name=company
property=name//html:link
   /td
  /tr 
 /logic:iterate
/table  

The global action forward viewCompany equals
company.do?flow=view

Any help and hints would be appreciated.
Thanks!
//Anna

__
Do You Yahoo!?
Listen to your Yahoo! Mail messages from any phone.
http://phone.yahoo.com



Fw:calling jsp with dynamic parameters

2001-05-25 Thread [EMAIL PROTECTED]

Hi,
I'm novice in struts,
I want :
1)to make my jsp (clientslist.jsp) display a dynamically
constructed list of objects (for example a list of clients)
2)When user select one of the client in the list, I want to
call another jsp, for example clientDetail.jsp passing client
nmber in argument.

How can use struts (Action et Form) to get the selected client.
I did'nt find any tag generating dynamical URL with argument.

Thanks