aspose file tools*
The moose likes Struts and the fly likes Dynamic Data in form submission Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Dynamic Data in form submission" Watch "Dynamic Data in form submission" New topic
Author

Dynamic Data in form submission

Robert Darling
Ranch Hand

Joined: Jun 21, 2008
Posts: 100



Each row will contain a unique card id. I want to include that card id when the form is submiited. i have hard coded &card_id=1 but i want it to read something like



The above code should be on a single line.
How will you do this. The above code does not work. This is struts 1. The card ID will be then read from the action file and processed accordingly. I know this should work i think its only a matter of escaping bean:write.

Kind Regards.


David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

JSP 2.0 container: use EL. Pre-JSP 2.0 container: use the struts-el tags. Tags cannot be nested like that--illegal JSP.
Robert Darling
Ranch Hand

Joined: Jun 21, 2008
Posts: 100

Could you please give me an example
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

That said, I'm not a fan of putting parameters in a form tag--that's what form elements are for.
Robert Darling
Ranch Hand

Joined: Jun 21, 2008
Posts: 100

Thanks for this. But this isnt working. The jsp is just iterating over a arraylist and displaying them in a table. Each table has a seperate submit button. How do i know which card the submit button was pressed for. How to call the getter and setter method accordingly.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You're already creating a separate form for each item--using a hidden form field seems the obvious solution.
Robert Darling
Ranch Hand

Joined: Jun 21, 2008
Posts: 100

How do i do this.

Will this set the selectedIndex property in the cardForm ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dynamic Data in form submission